allow command line parameter, some cleanup
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
66ac9d138e
commit
12f3e1e371
1 changed files with 11 additions and 8 deletions
|
@ -1,8 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
file="$1"
|
|
||||||
sep=';'
|
sep=';'
|
||||||
name='dryad'
|
name='dryad'
|
||||||
|
hostname="$1"; shift
|
||||||
|
ipnbase="$1"; shift
|
||||||
|
field="$1"; shift
|
||||||
|
file="$1"; shift
|
||||||
|
|
||||||
awk "-F$sep" 'BEGIN {
|
awk "-F$sep" 'BEGIN {
|
||||||
hc=1;
|
hc=1;
|
||||||
|
@ -23,11 +26,11 @@ awk "-F$sep" 'BEGIN {
|
||||||
|
|
||||||
/^S-09/
|
/^S-09/
|
||||||
{
|
{
|
||||||
mac = mac2dp($2)
|
mac = mac2dp($field);
|
||||||
print " host dryad" hc \
|
print \
|
||||||
" {\n hardware ethernet " mac
|
" host " hostname hc " {\n" \
|
||||||
";\n fixed-address 192.168.54."
|
" hardware ethernet " mac ";\n" \
|
||||||
i
|
" fixed-address " ipnbase hc ";\n" \
|
||||||
";\n }";
|
" }";
|
||||||
hc++;
|
hc++;
|
||||||
}' < "$1"
|
}' ipnbase="$ipnbase" field="$field" hostname="$hostname" < "$file"
|
||||||
|
|
Loading…
Reference in a new issue