aredn/files/etc/hotplug.d/iface/13-vtun

22 lines
706 B
Plaintext
Raw Normal View History

2015-04-01 09:42:53 -06:00
#!/bin/sh
# Handles setting up rules for tunnel interfaces
#echo "Interface is $INTERFACE $ACTION" >> /tmp/vtundscript.log
ISVPN=false
case "$INTERFACE" in
vpn*)
ISVPN=true;
;;
esac
if [ "$ISVPN" = true ]; then
INTF=tun${INTERFACE:3}
if [ $ACTION = "ifup" ] ; then
/usr/local/bin/vtun_up $INTF up
# echo "$INTF up" >> /tmp/vtundscript.log
elif [ $ACTION = "ifdown" ] ; then
/usr/local/bin/vtun_up $INTF down
# echo "$INTF down" >> /tmp/vtundscript.log
fi
fi