Disallow adding a host entry that is already permanent

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6345 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-05-14 18:24:38 +00:00
parent e80887169f
commit d80ebb0661

View File

@ -126,11 +126,14 @@ add_to_zone() # $1...${n-1} = <interface>[:<hosts>] $n = zone
;;
*)
for h in $hostlist; do
list_search +$h $hosts
if [ "$?" -gt 0 ]; then
newhostlist="$newhostlist +$h"
if ! list_search +$h $hosts; then
if ! list_search $h $hosts; then
newhostlist="$newhostlist +$h"
else
error_message "$h is already in zone $zone"
fi
else
error_message "$h already in zone $zone"
error_message "$h is already in zone $zone"
fi
done