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

23 lines
709 B
Bash

#!/bin/sh
# Handles setting up rules for tunnel interfaces
if [ -x "/usr/sbin/vtund" ]
then
ISVPN=false
case "$INTERFACE" in
tun*)
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
fi