examples/var_service/dhcp_if: make helper scripts more talkative
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
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 @@
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 @@
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"