summaryrefslogtreecommitdiff
path: root/examples/var_service
diff options
context:
space:
mode:
authorDenys Vlasenko2022-05-12 11:07:12 +0200
committerDenys Vlasenko2022-05-12 11:07:12 +0200
commitb9c2108b26ad1fe4634c250850a4abadff26c76e (patch)
treee0458bdcf5238a57138a9b71bb9c7f0fa59e9149 /examples/var_service
parent1099a27696cd733041db97f99da4e22ecd2424e5 (diff)
downloadbusybox-b9c2108b26ad1fe4634c250850a4abadff26c76e.zip
busybox-b9c2108b26ad1fe4634c250850a4abadff26c76e.tar.gz
examples/var_service/dhcp_if: make helper scripts more talkative
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples/var_service')
-rwxr-xr-xexamples/var_service/dhcp_if/convert2ipconf16
-rwxr-xr-xexamples/var_service/dhcp_if/convert2ntpconf2
-rwxr-xr-xexamples/var_service/dhcp_if/dhcp_handler6
-rwxr-xr-xexamples/var_service/dhcp_if/finish2
4 files changed, 16 insertions, 10 deletions
diff --git a/examples/var_service/dhcp_if/convert2ipconf b/examples/var_service/dhcp_if/convert2ipconf
index 31e3c7f..98f6546 100755
--- a/examples/var_service/dhcp_if/convert2ipconf
+++ b/examples/var_service/dhcp_if/convert2ipconf
@@ -19,7 +19,7 @@
#let cfg=cfg+1
#if[$cfg]=...; ip[$cfg]=...; ipmask[$cfg]=.../...; gw[$cfg]=...; net[$cfg]=... dns[$cfg]=...
-exec >/dev/null
+#exec >/dev/null
#exec >"$0.out" # debug
exec 2>&1
@@ -31,23 +31,31 @@ test "$ip" || exit 1
if ! test "$mask"; then
case "$ip" in
10.*)
+ echo "mask assumed 8 for ip=$ip"
mask=8;;
- 192.168.*)
- mask=16;;
#172.16-31.x.x
172.1[6789].*)
+ echo "mask assumed 12 for ip=$ip"
mask=12;;
172.2[0123456789].*)
+ echo "mask assumed 12 for ip=$ip"
mask=12;;
172.3[01].*)
+ echo "mask assumed 12 for ip=$ip"
mask=12;;
+ 192.168.*)
+ echo "mask assumed 16 for ip=$ip"
+ mask=16;;
esac
fi
# some servers do not return router option.
# assume DHCP server is the router.
if ! test "$router"; then
- test "$serverid" && router="$serverid"
+ if test "$serverid"; then
+ router="$serverid"
+ echo "No 'router' from the server, assuming 'serverid' is the router: $serverid"
+ fi
fi
{
diff --git a/examples/var_service/dhcp_if/convert2ntpconf b/examples/var_service/dhcp_if/convert2ntpconf
index e9d8293..f51740b 100755
--- a/examples/var_service/dhcp_if/convert2ntpconf
+++ b/examples/var_service/dhcp_if/convert2ntpconf
@@ -19,7 +19,7 @@
#let cfg=cfg+1
#ntpip[$cfg]=...
-exec >/dev/null
+#exec >/dev/null
#exec >"$0.out" # debug
exec 2>&1
diff --git a/examples/var_service/dhcp_if/dhcp_handler b/examples/var_service/dhcp_if/dhcp_handler
index 6a97e85..3e65262 100755
--- a/examples/var_service/dhcp_if/dhcp_handler
+++ b/examples/var_service/dhcp_if/dhcp_handler
@@ -38,12 +38,10 @@ file_ntpconf="$service.ntpconf"
dir_ipconf="/var/run/service/fw"
dir_ntpconf="/var/run/service/ntpd"
-exec >/dev/null
-#exec >>"$0.out" #debug
+#exec >/dev/null
+#exec >"$0.out" #debug
exec 2>&1
-echo "`date`: Params: $*"
-
if test x"$1" != x"bound" && test x"$1" != x"renew" ; then
# Reconfigure network with this interface disabled
echo "Deconfiguring"
diff --git a/examples/var_service/dhcp_if/finish b/examples/var_service/dhcp_if/finish
index 8ce1883..50bfe67 100755
--- a/examples/var_service/dhcp_if/finish
+++ b/examples/var_service/dhcp_if/finish
@@ -1,5 +1,5 @@
#!/bin/sh
-# executed when service is taken down ("sv d .")
+# executed when service is taken down ("svc -d .")
service=${PWD##*/}
file_ipconf="$service.ipconf"