Created
January 7, 2013 10:47
-
-
Save hydra1983/4474083 to your computer and use it in GitHub Desktop.
init script to connect or disconnect vpn client
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/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