2022-11-17 09:47:11 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# IP should be first arg
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
IP=$1
|
|
|
|
else
|
|
|
|
echo "IP not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-12-20 14:49:52 -08:00
|
|
|
if [[ `firewall-cmd --ipset=blacklist --query-entry $IP` = "yes" ]]; then
|
2022-11-17 09:47:11 -08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|