Dateiansicht:
Datei: | Projekte -> Apache,mod_evasive,iptables:Helfer-Skripte zum (zeitweisen) Blockieren von IP-Adressen -> fwunblock |
---|---|
md5: | 89e5a6a24000b654fcdc8e95b290b9ac |
sha1: | 2ec764eaceed93233234bc113a83eccf1dbe76e7 |
Download-Link: | Download |
- #!/usr/bin/sudo /bin/bash
- ## safety instructions: ##
- ## chown root:root ##
- ## chmod 0755 ##
- if [ -z "${1}" ]; then
- echo "Keine IP angegeben.";
- exit 1
- else
- ip=$(echo -n "${1}" | tr -cd '0123456789./');
- if iptables -D INPUT -s "${ip}" -j DROP; then
- fwlist | tee /tmp/fwlist.txt | grep "${ip}";
- echo "IP ${ip} is no longer blocked." | logger -t "fwunblock";
- exit 0;
- else
- exit 2;
- fi
- fi