指定したipがブラックリスト(SPAMHAUS)に載ったらメールを送る
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## ここのIPは逆に記入してください | |
### 例:192.168.1.10 → 10.1.168.192 とする | |
search_ip="ここにIPを逆順でいれる" | |
result=$(dig +short ${search_ip}.zen.spamhaus.org) | |
## デバッグ用 | |
#result=$(dig ${search_ip}.zen.spamhaus.org) | |
if test "$result" != "";then | |
echo "ip is spam!" | |
echo "check spamhaus! https://www.spamhaus.org/lookup/ " | mail -s "IP is DEAD! " 宛先@アドレス | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment