Created
February 11, 2016 02:55
-
-
Save esteinborn/28fc748f0537c40d46dc to your computer and use it in GitHub Desktop.
REconnect PPTP VPN profile for Synology
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 | |
#version 2014-04-26 | |
VPNC_CONNECTING="/usr/syno/etc/synovpnclient/vpnc_connecting" | |
#get connection name | |
CONNECTION=`cat /usr/syno/etc/synovpnclient/pptp/pptpclient.conf | grep conf_name | awk 'BEGIN {FS="="} {print $2}'` | |
#get connection id | |
ID=`ls /usr/syno/etc/synovpnclient/pptp/ | grep options | awk 'BEGIN {FS="_"} {print $2}' | awk 'BEGIN {FS="."} {print $1}'` | |
#create vpnc_connecting file | |
echo conf_id=$ID > $VPNC_CONNECTING && echo conf_name=$CONNECTION >> $VPNC_CONNECTING && echo proto=pptp >> $VPNC_CONNECTING | |
/usr/bin/killall synovpnc 2>/dev/null | |
#check running pptp | |
if echo `ifconfig ppp0` | grep -q "Link encap:Point-to-Point Protocol" | |
then | |
echo "VPN up" | |
else | |
/usr/syno/bin/synovpnc reconnect --protocol=pptp --name=$CONNECTION --retry=15 --interval=60 --keepfile & | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment