Fix bug in backup handling.

This commit is contained in:
Christoph 2017-08-04 13:49:47 +02:00
parent c924f98508
commit 67f2cf49ea

View File

@ -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