- Some minor fixes on script 'bind_change_ip.sh'.

- Redesign script 'bind_change_ttl.sh'.
- Redesign script 'bind_set_ttl_to_default.sh'.
This commit is contained in:
2017-08-02 03:37:04 +02:00
parent bbb8c5a023
commit af94d5de33
3 changed files with 620 additions and 174 deletions

View File

@@ -687,8 +687,6 @@ while IFS='' read -r _line || [[ -n $_line ]] ; do
fi
fi
if $_set_ipv6 ; then
if $(grep -q -e "$IPv6_ADDRESS_OLD" "$zone_file") ; then
if [ ${#zonefiles_arr[@]} -eq 0 ] ; then
@@ -713,12 +711,9 @@ echo ""
for zone_file in ${zonefiles_arr[@]} ; do
echo -e "\tconverting $zone_file.."
echo -e "\tEditing \033[1m$zone_file\033[m .."
## - calculate new serial
## -
@@ -777,7 +772,7 @@ for zone_file in ${zonefiles_arr[@]} ; do
if $_replaced_ipv6 && $IGNORE_ALT_HOSTNAMES ; then
echononl "\t Setting back hostnames containing \"-alt\".."
perl -i -n -p -e "s#^(.+(-alt).*)\s+IN\s+A\s+$IPv6_ADDRESS_NEW#\1 IN A $IPv6_ADDRESS_OLD#" $zone_file > /dev/null 2>&1
perl -i -n -p -e "s#^(.+(-alt).*)\s+IN\s+AAAA\s+$IPv6_ADDRESS_NEW#\1 IN AAAA $IPv6_ADDRESS_OLD#" $zone_file > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
else