bind_remove_domain_on_slave.sh: fix error if zone declaration is the last one in zone declaration file.
This commit is contained in:
parent
aef805100f
commit
27bff721f7
@ -472,6 +472,7 @@ while IFS='' read -r _line || [[ -n $_line ]] ; do
|
|||||||
if [[ "$_line" =~ type[[:space:]]+slave ]]; then
|
if [[ "$_line" =~ type[[:space:]]+slave ]]; then
|
||||||
_is_slave=true
|
_is_slave=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $_is_slave && [[ "$_line" =~ ^[[:space:]]*zone[[:space:]]+\"? ]]; then
|
if $_is_slave && [[ "$_line" =~ ^[[:space:]]*zone[[:space:]]+\"? ]]; then
|
||||||
_found=false
|
_found=false
|
||||||
_last_line=$((line_number - 1))
|
_last_line=$((line_number - 1))
|
||||||
@ -483,6 +484,14 @@ while IFS='' read -r _line || [[ -n $_line ]] ; do
|
|||||||
|
|
||||||
done < "$ZONES_DECLARATION_FILE"
|
done < "$ZONES_DECLARATION_FILE"
|
||||||
|
|
||||||
|
# - if zone declaration was the last one in file "$ZONES_DECLARATION_FILE"
|
||||||
|
# -
|
||||||
|
if $_found && [[ $_last_line -eq 0 ]]; then
|
||||||
|
_last_line=$line_number
|
||||||
|
_found=false
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if $_found ; then
|
if $_found ; then
|
||||||
fatal "Configuration for zone '${DOMAIN_REQUESTED_TO_REMOVE}' was found, but cannot be deleted."
|
fatal "Configuration for zone '${DOMAIN_REQUESTED_TO_REMOVE}' was found, but cannot be deleted."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user