Debian Codegraph @

scripts/clatd.ifupdown

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