From 34b0a70b4f0fdf1c8dc23175d6ff1cb1db62a9ae Mon Sep 17 00:00:00 2001 From: f Date: Thu, 1 Apr 2021 16:56:20 -0300 Subject: [PATCH] append dot if hostname contains domain --- nsupdate.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nsupdate.sh b/nsupdate.sh index 2d3b705..dd03c23 100755 --- a/nsupdate.sh +++ b/nsupdate.sh @@ -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 <