Skip to content

Instantly share code, notes, and snippets.

@farhaven
Created August 11, 2012 12:18
Show Gist options
  • Save farhaven/3324170 to your computer and use it in GitHub Desktop.
Save farhaven/3324170 to your computer and use it in GitHub Desktop.
#!/bin/sh
exec 2>&1
env > /tmp/up-${script_type}.env
if [ "${script_context}" != "init" ]; then
exit
fi
case "${script_type}" in
up)
/sbin/ifconfig "${dev}" "${ifconfig_local}" netmask "${ifconfig_netmask}" mtu "${tun_mtu}"
;;
route-up)
route add ${remote_1} ${route_net_gateway}
route delete default
route add default ${route_vpn_gateway}
;;
*)
echo "Unknown script type ${script_type}" | logger -t up
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment