-
-
Save jcf/0f6ebff1727887ab40fd to your computer and use it in GitHub Desktop.
Endpoint Security VPN FULL start/stop script for Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Toggle Checkpoint VPN firewall and VPN client | |
# | |
# http://git.io/vWAPU | |
set -e | |
APP='/Applications/Endpoint Security VPN.app' | |
KEXT='/System/Library/Extensions/cpfw.kext' | |
PLIST='/Library/LaunchDaemons/com.checkpoint.epc.service.plist' | |
SERVICE='com.checkpoint.epc.service' | |
UI_PROCESS_NAME='Endpoint_Security_VPN' | |
say () { | |
color="$1" | |
shift | |
echo -e "\033[$color;1m==>\033[0;1m $@\033[0m" | |
} | |
if sudo launchctl list "$SERVICE" &>/dev/null; then | |
say 31 "Tearing Checkpoint down..." | |
echo "Killing $UI_PROCESS_NAME..." | |
sudo killall "$UI_PROCESS_NAME" || true | |
echo "Unloading $PLIST..." | |
sudo launchctl unload "$PLIST" | |
echo "Unloading $KEXT..." | |
sudo kextunload "$KEXT" | |
else | |
say 32 "Bringing Checkpoint up..." | |
echo "Loading $PLIST..." | |
sudo launchctl load "$PLIST" | |
echo "Loading $KEXT..." | |
sudo kextload "$KEXT" | |
echo "Running $APP..." | |
open "$APP" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like this when you run it: