IsraelTorres

remove-pgp-kext.sh

Mar 20th, 2012
123
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Israel Torres
  3. # 2012-03-20
  4. # https://plus.google.com/u/0/102921309581624765133/posts/bSJZtiVXBRE
  5. # Mac OS X Lion 10.7.x with PGP Desktop Pro 10.2.x Kext fix on Filevaulted systems.
  6. # also can be run after initial install to make sure this doesn't happen upon the next update!
  7. # # manual:
  8. # 1. Boot up using Command+R
  9. # 2. Use Disk Utility and select the encrypted startup drive; you will be prompted to unlock the Disk.
  10. # 3. Close Disk Utility and when taken back open the Utilities and Select Terminal.
  11. # 4. Once in Terminal verify the offending kext (PGPwde.kext exists in the following path using ls)
  12. # ls /Volumes/Macintosh\ HD/System/Library/Extensions/PGPwde.kext
  13. # (it should return Contents)
  14. # 5. Once verified create a temporary directory (if you don't outright want to delete it) like so: mkdir /Volumes/Macintosh\ HD\jnk
  15. # 6. now move the kext to the ink (junk) directory like so:
  16. # mv /Volumes/Macintosh\ HD/System/Library/Extensions/PGPwde.kext /Volumes/Macintosh\ HD/jnk
  17. # 7. touch /System/Library/Extensions
  18. # 8. Click the upper left Apple and restart.
  19. # 9. You should now be able to login!!!! :D
  20. # programmatic:
  21. if [ $UID -eq 0 ]; then #SUDO check
  22.     BAD_FILE='/Volumes/Macintosh HD/System/Library/Extensions/PGPwde.kext'
  23.     FILENAME=$(basename "$BAD_FILE")
  24.     KEXTPATH=$(dirname "$BAD_FILE")
  25.     NEW_PATH='./jnk'
  26.     if [ -e "$BAD_FILE" ]; then
  27.         echo "$FILENAME file exists... proceeding with removal"
  28.         mkdir ./jnk 2> /dev/null
  29.         mv "$BAD_FILE" "$NEW_PATH"
  30.         if [ $? = 0 ]; then #move check
  31.             echo "$FILENAME moved to $NEW_PATH"
  32.             chown -R "$SUDO_USER" "$NEW_PATH" #replace ownership to user
  33.         else
  34.             echo "$FILENAME remains; something went horribly wrong; call for help!"
  35.         fi
  36.         touch "$KEXTPATH"
  37.     else
  38.         echo "file does not exist"
  39.     fi
  40. else
  41.     echo "warning: you need priviliges to run this: sudo ./remove-pgp-kext.sh"
  42.     echo "bailing out!"
  43. fi
  44. #eof
RAW Paste Data