prevent multiple registration of IP addresses
This commit is contained in:
parent
24eef73728
commit
00cd6cbfc7
1 changed files with 8 additions and 2 deletions
|
@ -91,14 +91,20 @@ get_IP_list()
|
||||||
register_IP()
|
register_IP()
|
||||||
# add a new allowed 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()
|
unregister_IP()
|
||||||
# remove the specified 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue