summaryrefslogtreecommitdiffhomepage
path: root/examples/var_service/dhcp_if/convert2ntpconf
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-09 09:39:50 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-09 09:39:50 +0100
commit391dd92ce218dea9a015e6b06f95403772876ac9 (patch)
tree073292e8e65ab85a0d19aea2b0f07671b8bfdd03 /examples/var_service/dhcp_if/convert2ntpconf
parentc3896850f748c4cff3e2a950f6b31f17c25ca141 (diff)
tweak dhcp service example - add ntp configuration
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples/var_service/dhcp_if/convert2ntpconf')
-rwxr-xr-xexamples/var_service/dhcp_if/convert2ntpconf34
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/var_service/dhcp_if/convert2ntpconf b/examples/var_service/dhcp_if/convert2ntpconf
new file mode 100755
index 000000000..debf1ebfe
--- /dev/null
+++ b/examples/var_service/dhcp_if/convert2ntpconf
@@ -0,0 +1,34 @@
+#!/bin/sh
+# convert:
+
+# dhcptype=5
+# serverid=172.16.42.102
+# lease=97200
+# interface=eth0
+# ip=172.16.42.177
+# subnet=255.255.255.0
+# mask=24
+# broadcast=172.16.22.255
+# router=172.16.42.98
+# dns=10.34.32.125 10.32.63.5 10.34.255.7 10.11.255.27
+# domain=lab.example.com example.com
+# ntpsrv=10.34.32.125 10.34.255.7
+
+# into:
+
+#let cfg=cfg+1
+#ntpip[$cfg]=...
+
+exec >/dev/null
+#exec >"$0.out" # debug
+exec 2>&1
+
+test "$interface" || exit 1
+test "$ip" || exit 1
+
+{
+for n in $ntpsrv; do
+ echo "let cfg=cfg+1"
+ echo "ntpip[\$cfg]='$n'";
+done
+} >"$1"