File: clatd.ifupdown

package info (click to toggle)
clatd 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 352 kB
  • sloc: perl: 821; makefile: 51; sh: 43
file content (49 lines) | stat: -rwxr-xr-x 826 bytes parent folder | download | duplicates (3)
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