# http://nami.jp/ipv4bycc/から最新版IPアドレスリストを取得する wget -q http://nami.jp/ipv4bycc/cidr.txt.gz # 展開 gunzip cidr.txt.gz # 取得できなかった場合 if [ ! -f cidr.txt ]; then if [ -f /tmp/cidr.txt ]; then # バックアップがある場合はその旨をroot宛にメール通知して処理を打ち切る echo cidr.txt was read from the backup! | mail -s root exit 1 else # バックアップがない場合はその旨をroot宛にメール通知して処理を打ち切る echo cidr.txt not found!|mail -s $0 root exit 1 fi fi # バックアップがある場合は更新日