From 67f2cf49ea6e917eaa06e4e2a01ea4b8c553b0c4 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 4 Aug 2017 13:49:47 +0200 Subject: [PATCH] Fix bug in backup handling. --- bind_set_renew_tlsa.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bind_set_renew_tlsa.sh b/bind_set_renew_tlsa.sh index 5b6fe7b..3f9457a 100755 --- a/bind_set_renew_tlsa.sh +++ b/bind_set_renew_tlsa.sh @@ -124,7 +124,7 @@ warn (){ info (){ if $verbose ; then echo "" - echo -e "\t[ \033[33m\033[1mInfo\033[m ]: $*" + echo -e "\t[ \033[32m\033[1mInfo\033[m ]: $*" echo "" fi } @@ -383,8 +383,7 @@ if grep -E "^$record_name.+$record_type" $zone_file > /dev/null 2>&1 ; then perl -i -n -p -e "s#^${record_name}.+${record_type}.*#$_replac_string#" $zone_file if [[ $? -eq 0 ]] ; then echo_ok - $verbose && echo "" - clean_up 1 + _return_value=1 else echo_failed error "Replacing TLSA Record failed!" @@ -392,7 +391,7 @@ if grep -E "^$record_name.+$record_type" $zone_file > /dev/null 2>&1 ; then fi fi else - warn "No Record for replacing fount in zonefile \"$(basename $zone_file)\"!" + warn "No Record for replacing found in zonefile \"$(basename $zone_file)\"!" declare -i _count @@ -487,8 +486,7 @@ else clean_up 99 fi - $verbose && echo "" - clean_up 2 + _return_value=2 fi @@ -507,5 +505,7 @@ if [[ -d "${zone_file_dir}.$backup_date" ]] ; then fi fi +warn "Serial was not incremented and zone not reloaded.\n\t Use script \033[1mbind_set_new_serial.sh\033[m to do that." + $verbose && echo "" -clean_up 99 +clean_up $_return_value