Skip to content

Instantly share code, notes, and snippets.

@hydra1983
Created January 7, 2013 10:47
Show Gist options
  • Save hydra1983/4474083 to your computer and use it in GitHub Desktop.
Save hydra1983/4474083 to your computer and use it in GitHub Desktop.
init script to connect or disconnect vpn client
#!/bin/sh
### BEGIN INIT INFO
# Provides: vpn
# Required-Start: $syslog $local_fs $remote_fs $network $named
# Required-Stop: $syslog $local_fs $remote_fs $network $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the vpn.
### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
. /lib/lsb/init-functions
export LANG='en_US.UTF-8'
export PATH=$PATH
case "$1" in
start)
/usr/bin/pon tovpn
;;
stop)
/usr/bin/poff tovpn
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment