pow のアンインストール時
rails を試すとき一緒に入れてみた pow だけど、入れた後に /etc/hosts に設定しといた「127.0.0.1 local.example.com」とかが見れなくなってしまっているのに気づいて一旦アンインストールしたくなった。
しかし、こんなエラーが。
$ curl get.pow.cx/uninstall.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 2547 101 2547 0 0 4139 0 --:--:-- --:--:-- --:--:-- 8575
Sorry to see you go. Uninstall Pow [y/n]? y
*** Uninstalling Pow...
grep: warning: recursive search of stdin
Password:
ipfw: rule 1: setsockopt(IP_FW_DEL): Invalid argument
しょうがないので、uninstall.sh の中身を見てみると、どうも以下の部分で引っかかっている様子
78 # Try to find the ipfw rule and delete it.
79
80 RULE=$(sudo ipfw show | (grep ",$HTTP_PORT .* dst-port $DST_PORT in" || true) | cut -f 1 -d " ")
81 [[ -n "$RULE" ]] && sudo ipfw del "$RULE"
だったので、
$ sudo ipfw -a list
00100 ... fwd 127.0.0.1,20559 tcp from any to me dst-port 80 in
65535 ... allow ip from any to any
$ sudo ipfw delete 00100
をして無事アンインストール&local.example.comも見れるようになった。