Last active
August 29, 2015 14:23
-
-
Save bookercodes/22e5ee290849d105c1c9 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
[Desktop Entry] | |
Name=AutoVpn | |
Exec=/home/booker/connectVpn.sh | |
Type=Application |
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/bash | |
while [ "true" ] | |
do | |
VPNCON=$(nmcli con show uuid 1e2fe74d-66dc-410c-9350-14f9a323bd39 | grep VPN.VPN-STATE | awk '{print $2}') | |
if [[ $VPNCON != "5" ]]; then | |
echo "Disconnected, trying to reconnect..." | |
(sleep 1s && nmcli con up uuid 1e2fe74d-66dc-410c-9350-14f9a323bd39) | |
else | |
echo "Already connected !" | |
fi | |
sleep 20 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment