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 (){ info (){
if $verbose ; then if $verbose ; then
echo "" echo ""
echo -e "\t[ \033[33m\033[1mInfo\033[m ]: $*" echo -e "\t[ \033[32m\033[1mInfo\033[m ]: $*"
echo "" echo ""
fi 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 perl -i -n -p -e "s#^${record_name}.+${record_type}.*#$_replac_string#" $zone_file
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then
echo_ok echo_ok
$verbose && echo "" _return_value=1
clean_up 1
else else
echo_failed echo_failed
error "Replacing TLSA Record 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
fi fi
else 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 declare -i _count
@ -487,8 +486,7 @@ else
clean_up 99 clean_up 99
fi fi
$verbose && echo "" _return_value=2
clean_up 2
fi fi
@ -507,5 +505,7 @@ if [[ -d "${zone_file_dir}.$backup_date" ]] ; then
fi fi
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 "" $verbose && echo ""
clean_up 99 clean_up $_return_value