mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
391dd92ce2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
35 lines
547 B
Bash
Executable File
35 lines
547 B
Bash
Executable File
#!/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"
|