summaryrefslogtreecommitdiff
path: root/examples/var_service/dhcp_if/convert2ipconf
diff options
context:
space:
mode:
authorDenys Vlasenko2009-11-09 09:39:50 +0100
committerDenys Vlasenko2009-11-09 09:39:50 +0100
commit391dd92ce218dea9a015e6b06f95403772876ac9 (patch)
tree073292e8e65ab85a0d19aea2b0f07671b8bfdd03 /examples/var_service/dhcp_if/convert2ipconf
parentc3896850f748c4cff3e2a950f6b31f17c25ca141 (diff)
downloadbusybox-391dd92ce218dea9a015e6b06f95403772876ac9.zip
busybox-391dd92ce218dea9a015e6b06f95403772876ac9.tar.gz
tweak dhcp service example - add ntp configuration
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples/var_service/dhcp_if/convert2ipconf')
-rwxr-xr-xexamples/var_service/dhcp_if/convert2ipconf22
1 files changed, 5 insertions, 17 deletions
diff --git a/examples/var_service/dhcp_if/convert2ipconf b/examples/var_service/dhcp_if/convert2ipconf
index cee0854..114ab05 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"