a guest Dec 13th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/bin/bash +x
- while [ "true" ]
- VPNCON=$(nmcli con show --active | grep *CBMSC* | cut -f1 -d " ")
- if [[ $VPNCON != "*CBMSC*" ]]; then
- echo "Disconnected, trying to reconnect..."
- (sleep 1s && nmcli con up uuid 0b40c452-f2f1-4a60-92a6-ca2086263127)
- echo "Already connected !"
- sleep 10
- #append to ~/.profile: /opt/reconnect-vpn.sh &
- #find out vpn's uuid: nmcli con
- #don't forget to: sudo chmod 777 reconnect-vpn.sh
RAW Paste Data