all: sync with master; upd chlog
This commit is contained in:
22
docker/dns-bind.awk
Normal file
22
docker/dns-bind.awk
Normal file
@@ -0,0 +1,22 @@
|
||||
/^[^[:space:]]/ { is_dns = /^dns:/ }
|
||||
|
||||
/^[[:space:]]+bind_hosts:/ { if (is_dns) prev_line = FNR }
|
||||
|
||||
/^[[:space:]]+- .+/ {
|
||||
if (FNR - prev_line == 1) {
|
||||
addrs[addrsnum++] = $2
|
||||
prev_line = FNR
|
||||
}
|
||||
}
|
||||
|
||||
/^[[:space:]]+port:/ { if (is_dns) port = $2 }
|
||||
|
||||
END {
|
||||
for (i in addrs) {
|
||||
if (match(addrs[i], ":")) {
|
||||
print "[" addrs[i] "]:" port
|
||||
} else {
|
||||
print addrs[i] ":" port
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user