Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
指定したipがブラックリスト(SPAMHAUS)に載ったらメールを送る
#!/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
You can’t perform that action at this time.