1 #!/bin/sh /etc/rc.common
7 config_get_bool enabled
"$cfg" enabled
1
8 [ "$enabled" -gt 0 ] ||
return
10 config_get dev1
"$cfg" dev1
11 config_get dev2
"$cfg" dev2
13 [ -d "/sys/kernel/debug/trelay/${dev1}-${dev2}" ] && return
14 [ -d "/sys/class/net/${dev1}" -a -d "/sys/class/net/${dev2}" ] ||
return
18 echo "${dev1}-${dev2},${dev1},${dev2}" > /sys
/kernel
/debug
/trelay
/add
23 config_foreach check_relay trelay
24 touch /var
/run
/trelay.active
28 rm -f /var
/run
/trelay.active
29 for relay
in /sys
/kernel
/debug
/trelay
/*; do
30 [ -d "$relay" ] && echo > "$relay/remove"