Skip to content

Instantly share code, notes, and snippets.

@obcode
Created July 15, 2011 12:24
Show Gist options
  • Save obcode/1084596 to your computer and use it in GitHub Desktop.
Save obcode/1084596 to your computer and use it in GitHub Desktop.
vpnc.sh für Gentoo User
#!/bin/bash
source /lib64/rc/sh/functions.sh
ebegin "Connecting to the VPN"
vpnc
eend
ebegin "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
eend
einfo "Press any key to disconnect ..."
read $disconnect
ebegin "Disconnecting from the VPN"
vpnc-disconnect
eend
ebegin "Reconfiguring the default routing table"
route add default gw 192.168.178.1
eend
einfo "VPN should now be disconnected"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment