IP アドレスのブラックリストを取得してブロックする簡単なスクリプトを作成しているときに、次の問題に遭遇しました。
## Function giving greif
function _droplist (){
while read line; do
$IPT -A droplist -i eth1 -s $line -j LOG --log-prefix "IP BlockList "
$IPT -A droplist -i eth1 -s $line -j DROP
done < $badlist ##IPT is /sbin/iptables
}
この関数を何度か繰り返すと、エラーが発生します。
Try `iptables -h' or 'iptables --help' for more information.
' not found.4.12: host/network `SO.ME.IPH.ERE
IP でハードコーディングされた同じスクリプトを実行しても問題なく動作します。これは $line に関係するものか、iptables の m 実装に関係しています。
乾杯 - 困惑。