Advertisement
geofferey

[BASH] Prey Anti-theft Installer for PowerPC Mac OSX

Mar 12th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.86 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #PREY 0.6.2 automated installer for PowerPC
  4. #This script was desiged to install http://www.preyproject.com
  5. #Anti-theft software on older PowerPC computers running OSX
  6. #Download the batch installer from http://preyproject.com/releases/current/prey-0.6.2-mac-batch.mpkg.zip
  7. # & run this script from same directory as batch installer
  8.  
  9. DIR_1=/usr/share/curl
  10.  
  11. echo ""
  12. echo " ## Watch as PREY 0.6.2 gracefully spreads its wings on your old PowerPC!"
  13. echo " ## $(uname -n) $(uname -s) $(uname -r) $(uname -m) $(uname -p)"
  14. echo " ## $(date)"
  15. echo ""
  16.  
  17. if [ $(find "$DIR_1" -name old.curl-ca-bundle.crt |wc -l) -eq 0 ]; then
  18. echo " ## I'll bet that your certificate-bundle is outdated!";
  19. echo " ## They're required in order to establish a connection.";
  20. echo " ## I will take the liberty of updating them for you.";
  21. echo " ## Only good should come from this :)";
  22. echo ""
  23. curl http://curl.haxx.se/ca/cacert.pem -o /usr/share/curl/new_cacert.pem;
  24. echo ""
  25. while true
  26.   do
  27.     read -r -p ' ## Would you like me to continue? ' choice
  28.     case "$choice" in
  29.     n|N|no|No|NO) echo " ## Aw Snap! PREY might not like that :(";
  30.     break;;
  31.     y|Y|yes|yes|Yes|YEs|YES|YeS|yeS|yES) echo " ## I think you made the right choice :)";
  32.     mv $DIR_1/curl-ca-bundle.crt $DIR_1/old.curl-ca-bundle.crt;
  33.     echo "";
  34.     mv "$DIR_1"/new_cacert.pem "$DIR_1"/curl-ca-bundle.crt;
  35.     break;;
  36.     *) echo ' ## Not a valid response!';;
  37.   esac
  38.   done
  39. fi
  40.  
  41. echo ""
  42.  
  43. read -p " ## Please provide your API Key:" INPUT_API_KEY
  44.  
  45. while [[ -z "$INPUT_API_KEY" ]]; do
  46. echo "";
  47. echo " API Key can't be blank, you can find it at:";
  48. echo " https://panel.preyproject.com/profile";
  49. echo ""
  50. read -s -p " Please provide your API Key:" INPUT_API_KEY;
  51. echo "";
  52. done
  53.  
  54. export API_KEY="$INPUT_API_KEY"
  55.  
  56. installer -pkg ./prey-0.6.2-mac-batch.mpkg -target / && /usr/share/prey/prey.sh -c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement