diff --git a/examples/var_service/dhcp_if/convert2ipconf b/examples/var_service/dhcp_if/convert2ipconf index 31e3c7fde..98f6546bf 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 e9d829308..f51740ba0 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 6a97e8543..3e652621d 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 8ce188336..50bfe67b5 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"