Skip to content

Instantly share code, notes, and snippets.

@swissmanu
Last active January 31, 2019 09:35
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save swissmanu/7b200f9467d9e0b19a73 to your computer and use it in GitHub Desktop.
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
#!/bin/bash
#
# by Manuel Alabor <manuel@alabor.me>
# 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
@svenlenz
Copy link

svenlenz commented Nov 8, 2016

Für macOS Sierra musste ich den unload der Kernelextension wie folgt anpassen:

sudo kextunload -b com.checkpoint.cpfw

@bjornkri
Copy link

Thank you! Had to install this crap for a small project for a client, and it wouldn't go away.

@vjpr
Copy link

vjpr commented Oct 14, 2017

Thanks! This happened to me too and broke ShareMouse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment