From 391dd92ce218dea9a015e6b06f95403772876ac9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 9 Nov 2009 09:39:50 +0100 Subject: tweak dhcp service example - add ntp configuration Signed-off-by: Denys Vlasenko --- examples/var_service/dhcp_if/convert2ipconf | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'examples/var_service/dhcp_if/convert2ipconf') diff --git a/examples/var_service/dhcp_if/convert2ipconf b/examples/var_service/dhcp_if/convert2ipconf index cee085463..114ab0555 100755 --- a/examples/var_service/dhcp_if/convert2ipconf +++ b/examples/var_service/dhcp_if/convert2ipconf @@ -19,24 +19,12 @@ #let cfg=cfg+1 #if[$cfg]=...; ip[$cfg]=...; ipmask[$cfg]=.../...; gw[$cfg]=...; net[$cfg]=... dns[$cfg]=... -exec >"$0.out" 2>&1 +exec >/dev/null +#exec >"$0.out" # debug +exec 2>&1 test "$interface" || exit 1 -test -f "$1" || exit 1 - -# Unsafe, and does not handle values with spaces: -#. "./$1" || exit 1 -# Safe(r) parsing: -sq="'" -while read line; do - #echo "line: $line" - # Skip empty lines and lines with single quotes - test "${line##*$sq*}" || continue - var="${line%%=*}" - val="${line#*=}" - #echo "var:$var val:'$val'" - eval "$var='$val'" -done <"$1" +test "$ip" || exit 1 { echo "let cfg=cfg+1" @@ -50,4 +38,4 @@ test "$dns" && echo "dns[\$cfg]='$dns'" # which subnet(s) is/are available thru advertised router # Assume 0/0 echo "net[\$cfg]='0/0'" -} >"$2" +} >"$1" -- cgit v1.2.3