Created
February 12, 2013 13:46
-
-
Save ecarreras/4769981 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| VPN_PATH="/etc/openvpn/porta/[email protected]" | |
| VPN_CONFIG="[email protected]" | |
| case "$1" in | |
| start) | |
| echo "Connecting to GISCE VPN" | |
| openvpn --client --config $VPN_PATH/$VPN_CONFIG &>$VPN_PATH/logfile & | |
| ;; | |
| stop) | |
| echo "Disconnecting from GISCE VPN" | |
| VPN_PID=`ps aux|grep "openvpn --client "|awk '{print $2}'|head -n 1` | |
| kill -9 $VPN_PID | |
| ;; | |
| restart) | |
| /etc/init.d/vpn-GISCE.sh stop | |
| /etc/init.d/vpn-GISCE.sh start | |
| ;; | |
| *) | |
| echo "Usage: /etc/init.d/vpn-GISCE.sh {start|stop|restart}" | |
| exit 1 | |
| ;; | |
| esac | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment