Guest User

Untitled

a guest
Sep 30th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
  4. # which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
  5. # from time to time
  6. # Usage: checkpoint.sh
  7. # The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
  8. # Or, make an Automator action and paste the script.
  9. # You will need sudo power, of course
  10. #
  11.  
  12. SERVICE='Endpoint_Security_VPN'
  13.  
  14. if ps ax | grep -v grep | grep $SERVICE > /dev/null
  15. then
  16. # $SERVICE is running. Shut it down.
  17. killall $SERVICE
  18. osascript -e 'do shell script "sudo launchctl unload /Library/LaunchDaemons/com.checkpoint.epc.service.plist && sudo kextunload /System/Library/Extensions/cpfw.kext" with administrator privileges'
  19. else
  20. # $SERVICE is not running. Fire it up.
  21. osascript -e 'do shell script "sudo launchctl load /Library/LaunchDaemons/com.checkpoint.epc.service.plist && sudo kextload /System/Library/Extensions/cpfw.kext" with administrator privileges'
  22. /Applications/Endpoint\ Security\ VPN.app/Contents/MacOS/Endpoint_Security_VPN 2>1 > /dev/null &
  23. fi
Add Comment
Please, Sign In to add comment