prevent multiple registration of IP addresses

This commit is contained in:
lars 2005-05-18 18:09:43 +00:00
parent 24eef73728
commit 00cd6cbfc7

View file

@ -91,14 +91,20 @@ get_IP_list()
register_IP()
# add a new allowed IP
{
eval `echo "$RULE_ADD" | sed "s/_IP_/$1/g"`
if get_IP_list | grep -q "^$1$"
then echo "die IP $1 war bereits freigeschaltet!"
else eval `echo "$RULE_ADD" | sed "s/_IP_/$1/g"`
fi
}
unregister_IP()
# remove the specified IP
{
eval `echo "$RULE_DEL" | sed "s/_IP_/$1/g"`
if get_IP_list | grep -q "^$1$"
then eval `echo "$RULE_DEL" | sed "s/_IP_/$1/g"`
else echo "die IP $1 war nicht freigeschaltet!"
fi
}