Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #because the autoconnect VPN has been broken in gnome for quite some time here is a little fix for it. Its simple, so if you want you could add graphics/etc.
- #!/bin/bash
- echo "which vpn do you want?
- 1: WA
- 2: NY"
- read VPN
- if [ "$VPN" = "1" ]
- then
- VPN_CONNECTION_NAME="WA" # change the quotes to your VPN connection name
- elif [ "$VPN" = "2" ]
- then
- VPN_CONNECTION_NAME="NY" # change the quotes to your VPN connection name
- fi
- activ_con=$(nmcli con status | grep "${REQUIRED_CONNECTION_NAME}")
- activ_vpn=$(nmcli con status | grep "${VPN_CONNECTION_NAME}")
- if [ "${activ_con}" -a ! "${activ_vpn}" ];
- then
- nmcli con up id "${VPN_CONNECTION_NAME}"
- else
- echo "You were not connected."
- fi
- sleep 60
- # dont forget to chmod+x the file after you copy/paste this.
- # credit due to qertoip on http://thesingularity.pl/blog/2011/solved-how-to-auto-connect-to-a-vpn-on-startup-in-ubuntu-11-10/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement