bind_add_dkim_zone_master.sh: fix error in searching for zone file declaration.
This commit is contained in:
parent
fff7ba5408
commit
f018611912
@ -375,9 +375,9 @@ _zone_configuration_exists=false
|
||||
|
||||
|
||||
|
||||
if $(grep -q -E "^\s*zone\s+\"$zone\"" $ZONES_DECLARATION_FILE 2>/dev/null) ; then
|
||||
if $(grep -q -E "^\s*zone\s+\"$new_dkim_zone\"" $ZONES_DECLARATION_FILE 2>/dev/null) ; then
|
||||
|
||||
info "Zone file declaration for "$zone" already exists."
|
||||
info "Zone file declaration for "$new_dkim_zone" already exists."
|
||||
_zone_configuration_exists=true
|
||||
|
||||
# - Determine zonefile (by reading bind configuration)
|
||||
@ -385,7 +385,7 @@ if $(grep -q -E "^\s*zone\s+\"$zone\"" $ZONES_DECLARATION_FILE 2>/dev/null) ; t
|
||||
echononl "Check if zonefile already exists (by reading bind configuration)"
|
||||
_found=false
|
||||
declare -i _number=0
|
||||
regex_zone="^[[:space:]]*zone[[:space:]]+\"$zone\""
|
||||
regex_zone="^[[:space:]]*zone[[:space:]]+\"$new_dkim_zone\""
|
||||
regex_file="^[[:space:]]*file"
|
||||
while IFS='' read -r line || [[ -n "$line" ]] ; do
|
||||
if [[ $line =~ $regex_zone ]]; then
|
||||
@ -420,7 +420,7 @@ if $(grep -q -E "^\s*zone\s+\"$zone\"" $ZONES_DECLARATION_FILE 2>/dev/null) ; t
|
||||
else
|
||||
if [[ -n "$zone_file" ]] && [[ -f "$zone_file" ]]; then
|
||||
info "Also zone file '$zone_file' exists"
|
||||
clean_up 1
|
||||
clean_up 2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user