Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash +x
  2. while [ "true" ]
  3. do
  4.         VPNCON=$(nmcli con show --active | grep *CBMSC* | cut -f1 -d " ")
  5.         if [[ $VPNCON != "*CBMSC*" ]]; then
  6.                 echo "Disconnected, trying to reconnect..."
  7.                 (sleep 1s && nmcli con up uuid 0b40c452-f2f1-4a60-92a6-ca2086263127)
  8.         else
  9.                 echo "Already connected !"
  10.         fi
  11.         sleep 10
  12. done
  13.  
  14. #append to ~/.profile: /opt/reconnect-vpn.sh &
  15. #find out vpn's uuid: nmcli con
  16. #don't forget to: sudo chmod 777 reconnect-vpn.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement