aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-05-20 22:43:42 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-05-20 22:43:42 +0200
commita40a661d971cf75c617c83357ac0e87a45f41f4f (patch)
treebfdf4805a4c53bf0c6b683a1b6fab1b145ea2b58
parent2ccd3522816291bd7e3ede3f60370d725d86e179 (diff)
downloadbusybox-w32-a40a661d971cf75c617c83357ac0e87a45f41f4f.tar.gz
busybox-w32-a40a661d971cf75c617c83357ac0e87a45f41f4f.tar.bz2
busybox-w32-a40a661d971cf75c617c83357ac0e87a45f41f4f.zip
tweak /var/service example
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-xexamples/var_service/ifplugd_if/ifplugd_handler23
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
6if test -d "/var/service/dhcp_$1"; then 6if 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
15fi 11fi
12if 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"
17fi
18# Parent ifplugd exits if we exit with nonzero.
19# Do not startle it:
20exit 0