Last active
January 31, 2019 09:35
-
-
Save swissmanu/7b200f9467d9e0b19a73 to your computer and use it in GitHub Desktop.
A shell script to start/stop Check Point Endpoint VPN/Firewall clients on Mac OS X. No more unreachable machines in your network if no VPN is necessary. Tested with version 80.61
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 | |
# | |
# by Manuel Alabor <[email protected]> | |
# https://github.com/swissmanu | |
# | |
SCRIPT_NAME=`basename $0` | |
VERSION="0.0.1" | |
print_help() | |
{ | |
echo "==============================================================" | |
echo "$SCRIPT_NAME v$VERSION" | |
echo "Utility to start and stop Check Point Endpoint VPN/Firewall." | |
echo "Make sure you use it as root." | |
echo "--------------------------------------------------------------" | |
echo "" | |
echo "Usage:" | |
echo " $SCRIPT_NAME {start|stop}" | |
echo "" | |
echo "Options:" | |
echo " -h Shows this text" | |
echo "" | |
echo "Commands:" | |
echo " start Starts the VPN daemon" | |
echo " stop Stops the VPN daemon and unloads the kext" | |
echo "" | |
echo "Examples:" | |
echo " $SCRIPT_NAME start" | |
echo " $SCRIPT_NAME stop" | |
echo "" | |
echo "==============================================================" | |
} | |
while getopts ":h" opt; do | |
case $opt in | |
h) | |
print_help | |
exit 0 | |
;; | |
\?) | |
echo "Invalid Option: -$OPTARG" >&2 | |
print_help | |
exit 1 | |
;; | |
esac | |
done | |
shift $((OPTIND-1)) | |
COMMAND=$1 | |
if [[ $EUID -ne 0 ]]; then | |
echo "" >&2 | |
echo "sudo you should use, young padawan." >&2 | |
echo "" >&2 | |
print_help | |
exit 1 | |
fi | |
case "$COMMAND" in start | stop) ;; | |
*) | |
echo "" >&2 | |
echo "Invalid command given." >&2 | |
echo "" >&2 | |
print_help | |
exit 1 | |
;; | |
esac | |
case "${COMMAND}" in | |
start) | |
echo "Start VPN Service" | |
launchctl load /Library/LaunchDaemons/com.checkpoint.epc.service.plist | |
;; | |
stop) | |
echo "Shutdown VPN Service" | |
launchctl unload /Library/LaunchDaemons/com.checkpoint.epc.service.plist | |
sudo kextunload /System/Library/Extensions/cpfw.kext | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! This happened to me too and broke ShareMouse.