From 38957e58c1c9def8558981ea8d175737bd99a043 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 25 Dec 2023 21:50:16 +0100 Subject: [PATCH] tmp_bind_change_ip.sh,tmp_bind_change_ttl.sh: fix errors. --- ...mp_bind.conf,sample => tmp_bind.conf.sample} | 0 tmp_bind_change_ip.sh | 17 +++++++++++------ tmp_bind_change_ttl.sh | 17 +++++++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) rename conf/{tmp_bind.conf,sample => tmp_bind.conf.sample} (100%) diff --git a/conf/tmp_bind.conf,sample b/conf/tmp_bind.conf.sample similarity index 100% rename from conf/tmp_bind.conf,sample rename to conf/tmp_bind.conf.sample diff --git a/tmp_bind_change_ip.sh b/tmp_bind_change_ip.sh index a696b60..8447ec2 100755 --- a/tmp_bind_change_ip.sh +++ b/tmp_bind_change_ip.sh @@ -602,17 +602,22 @@ while IFS='' read -r _line || [[ -n $_line ]] ; do shopt -u extglob fi - if [[ -n "${zone_file}" ]] ; then + if $_is_master && [[ -n "${zone_file}" ]] ; then if [[ ! -f "${zone_file}" ]] ; then if ! containsElement "${zone_file}" "${zonefiles_not_present_arr[@]}" ; then zonefiles_not_present_arr+=("${zone_file}") fi + _is_master=false + _found=false + zone_file="" continue - fi - if ! $(echo ${zone_file} | grep -q -e "$ZONE_FILE_MASTER_DIR" 2> /dev/null) ; then - fatal "Zonefile to change does not live in directory '$ZONE_FILE_MASTER_DIR'! - - Zonefile to change: \033[33m${zone_file}\033[m" + else + if ! $(echo ${zone_file} | grep -q -e "$ZONE_FILE_MASTER_DIR" 2> /dev/null) ; then + _is_master=false + _found=false + zone_file="" + continue + fi fi fi diff --git a/tmp_bind_change_ttl.sh b/tmp_bind_change_ttl.sh index 405ffc6..ba977a9 100755 --- a/tmp_bind_change_ttl.sh +++ b/tmp_bind_change_ttl.sh @@ -599,17 +599,22 @@ while IFS='' read -r _line || [[ -n $_line ]] ; do shopt -u extglob fi - if [[ -n "${zone_file}" ]] ; then + if $_is_master && [[ -n "${zone_file}" ]] ; then if [[ ! -f "${zone_file}" ]] ; then if ! containsElement "${zone_file}" "${zonefiles_not_present_arr[@]}" ; then zonefiles_not_present_arr+=("${zone_file}") fi + _is_master=false + _found=false + zone_file="" continue - fi - if ! $(echo ${zone_file} | grep -q -e "$ZONE_FILE_MASTER_DIR" 2> /dev/null) ; then - fatal "Zonefile to change does not live in directory '$ZONE_FILE_MASTER_DIR'! - - Zonefile to change: \033[33m${zone_file}\033[m" + else + if ! $(echo ${zone_file} | grep -q -e "$ZONE_FILE_MASTER_DIR" 2> /dev/null) ; then + _is_master=false + _found=false + zone_file="" + continue + fi fi fi