Many folks out there have been using ipfw with their OS X machines. Unfortunately, many scripts out there in tutorials will hang if your machine is not connected/dialed into a network.
I've found this issue can be easily solved by adding the following lines at the top of your firewall script (right after the top #! line):
if ! ifconfig -a | grep "status:" | awk '{ print $6 }' | grep "^active" > /dev/null
then
echo "exiting early"
exit
fiThis will run ifconfig and check for active interfaces. Note that all interfaces seem to be up in OS X, whether they are actually connected to a network or not. If it doesn't find any, it will abort the script, thus not hanging forever.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020130232715106