append dot if hostname contains domain
This commit is contained in:
parent
72e5499ab9
commit
34b0a70b4f
1 changed files with 4 additions and 1 deletions
|
@ -9,12 +9,15 @@ test -z "${IP6}" && exit 1
|
|||
test -z "${KNOT}" && exit 1
|
||||
test -z "${DOMAIN}" && exit 1
|
||||
|
||||
# Add a dot if the hostname contains the domain
|
||||
echo "${HOSTNAME}" | grep -q "\.${DOMAIN}$" && DOT="."
|
||||
|
||||
knsupdate <<DNS
|
||||
server ${KNOT}
|
||||
zone ${DOMAIN}.
|
||||
origin ${DOMAIN}.
|
||||
ttl 60
|
||||
add ${HOSTNAME} AAAA ${IP6}
|
||||
add ${HOSTNAME}${DOT} AAAA ${IP6}
|
||||
send
|
||||
quit
|
||||
DNS
|
||||
|
|
Loading…
Reference in a new issue