Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash +x
- while [ "true" ]
- do
- 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)
- else
- echo "Already connected !"
- fi
- sleep 10
- done
- #append to ~/.profile: /opt/reconnect-vpn.sh &
- #find out vpn's uuid: nmcli con
- #don't forget to: sudo chmod 777 reconnect-vpn.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement