mirror of https://github.com/toreanderson/clatd
add ifupdown integration
This commit is contained in:
parent
ff6aa57c4b
commit
54990b0389
|
|
@ -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
|
||||
Loading…
Reference in New Issue