ddns-scripts: initialise the is_glue variable

Improve the code as suggested by Christian Schoenebeck.

Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
Mathias Kresin
2016-06-04 07:30:53 +02:00
parent 9946769206
commit ed11871c56
4 changed files with 4 additions and 4 deletions

View File

@@ -956,7 +956,7 @@ get_registered_ip() {
# 1 no IP detected
[ $# -lt 1 -o $# -gt 2 ] && write_log 12 "Error calling 'get_registered_ip()' - wrong number of parameters"
[ $is_glue -eq 1 ] && [ -z "$(which host)" ] && write_log 12 "Update of glue records is only supported using BIND host"
[ $is_glue -eq 1 -a -z "$(which host)" ] && write_log 12 "Update of glue records is only supported using BIND host"
write_log 7 "Detect registered/public IP"
# set correct regular expression
@@ -1040,8 +1040,6 @@ get_registered_ip() {
write_log 7 "$(cat $ERRFILE)"
else
if [ "$__PROG" = "BIND host" ]; then
__DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
if [ $is_glue -eq 1 ]; then
__DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -m 1 -o "$__REGEX" )
else