Created
July 15, 2011 12:21
-
-
Save obcode/1084592 to your computer and use it in GitHub Desktop.
vpnc.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Connecting to the VPN" | |
vpnc | |
echo "Modifying the routing table" | |
echo "nameserver 127.0.0.1" > /etc/resolv.conf | |
echo "nameserver 192.168.178.1" >> /etc/resolv.conf | |
route add default gw 192.168.178.1 | |
route add -net 212.201.64.0 netmask 255.255.254.0 dev tun0 | |
echo "Press any key to disconnect ..." | |
read $disconnect | |
echo "Disconnecting from the VPN" | |
vpnc-disconnect | |
echo "Reconfiguring the default routing table" | |
route add default gw 192.168.178.1 | |
echo "VPN should now be disconnected" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment