23 lines
359 B
Bash
23 lines
359 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# IP should be first arg
|
||
|
if [ -n "$1" ]; then
|
||
|
IP=$1
|
||
|
else
|
||
|
echo "IP not set"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [[ firewall-cmd --ipset=blacklist --query-entry $IP >/dev/null ]]; then
|
||
|
|
||
|
firewall-cmd --ipset=blacklist --remove-entry=$IP
|
||
|
firewall-cmd --permanent --ipset=blacklist --remove-entry=$IP
|
||
|
|
||
|
else
|
||
|
|
||
|
echo "IP $IP not in blacklist. Doing nothing."
|
||
|
|
||
|
fi
|
||
|
|
||
|
|