Skip to content

Instantly share code, notes, and snippets.

@nunomcruz
Forked from phoob/checkpoint.sh
Last active April 24, 2020 08:41
Show Gist options
  • Save nunomcruz/4212e688baf089450839417a4ee022f0 to your computer and use it in GitHub Desktop.
Save nunomcruz/4212e688baf089450839417a4ee022f0 to your computer and use it in GitHub Desktop.
The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just from time to time.
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# 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.
# Or, make an Automator action and paste the script. You will need sudo power.
#
# To prevent Endpoint Security VPN from starting automatically whenever you restart your Mac, edit this file:
# `/Library/LaunchAgents/com.checkpoint.eps.gui.plist`
# And change
# `<key>RunAtLoad</key>`
# `<true/>`
# to
# `<key>RunAtLoad</key>`
# `<false/>`
# [Source](https://superuser.com/questions/885273)
SERVICE='Endpoint_Security_VPN'
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
# $SERVICE is running. Shut it down
sudo launchctl unload /Library/LaunchDaemons/com.checkpoint.epc.service.plist
sudo kextunload -b com.checkpoint.cpfw
killall $SERVICE
else
# $SERVICE is not running. Fire it up
sudo launchctl load /Library/LaunchDaemons/com.checkpoint.epc.service.plist
sudo kextload /Library/Extensions/cpfw.kext
open '/Applications/Endpoint Security VPN.app'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment