1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#!/bin/sh
# clatd(8) integration in interfaces(5)
# To use just copy this script to /etc/network/if-up.d/ and
# /etc/network/if-down.d/
# To configure which connection should include clatd the file
# /etc/default/clatd is used. To enable clatd on a interface
# include the interface in CLATD_IFACES (space sperated)
# For logical intefaces (i.e. wpa_supplicant integration) you
# can also set one CLATD_LOGICAL. See interfaces(5) for details.
. /etc/default/clatd
use_clatd=0
for iface in $CLATD_IFACES
do
if [ "$iface" = "$IFACE" ]
then
use_clatd=1
break
fi
done
if [ "$LOGICAL" = "$CLATD_LOGICAL" ]
then
use_clatd=1
fi
if [ "$use_clatd" -ne 1 ]
then
exit 0
fi
case "$PHASE" in
post-up)
systemctl start clatd@"$IFACE"
exit 0
;;
pre-down)
systemctl stop clatd@"$IFACE"
;;
*)
exit 0
;;
esac
|