diff options
-rwxr-xr-x | examples/var_service/ifplugd_if/ifplugd_handler | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/examples/var_service/ifplugd_if/ifplugd_handler b/examples/var_service/ifplugd_if/ifplugd_handler index 4962fcf98..0749019f1 100755 --- a/examples/var_service/ifplugd_if/ifplugd_handler +++ b/examples/var_service/ifplugd_if/ifplugd_handler | |||
@@ -3,13 +3,18 @@ | |||
3 | # $1: interface | 3 | # $1: interface |
4 | # $2: state | 4 | # $2: state |
5 | 5 | ||
6 | if test -d "/var/service/dhcp_$1"; then | 6 | if test x"$2" = x"down"; then |
7 | if test x"$2" = x"down"; then | 7 | echo "Downing dhcp_$1" |
8 | echo "Downing /var/service/dhcp_$1" | 8 | svc -d "dhcp_$1" |
9 | sv d "/var/service/dhcp_$1" | 9 | echo "Downing zcip_$1" |
10 | fi | 10 | svc -d "zcip_$1" |
11 | if test x"$2" = x"up"; then | ||
12 | echo "Upping /var/service/dhcp_$1" | ||
13 | sv u "/var/service/dhcp_$1" | ||
14 | fi | ||
15 | fi | 11 | fi |
12 | if test x"$2" = x"up"; then | ||
13 | echo "Upping dhcp_$1" | ||
14 | svc -u "dhcp_$1" | ||
15 | echo "Upping zcip_$1" | ||
16 | svc -u "zcip_$1" | ||
17 | fi | ||
18 | # Parent ifplugd exits if we exit with nonzero. | ||
19 | # Do not startle it: | ||
20 | exit 0 | ||