add ifupdown integration

This commit is contained in:
satanist 2023-08-05 15:15:14 +02:00
parent ff6aa57c4b
commit 54990b0389
1 changed files with 37 additions and 0 deletions

37
scripts/clatd.ifupdown Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
. /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