daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top