April 22, 2007

New Router

I've been documenting my efforts at getting my new router up and running over at WRTSL54GS Adventures, basically just a place for me to make notes to myself. ;) My Linksys WRTSL54GS is now up and running, and so the Firewall script that I had just put into production here is now a thing of the past, now that I can handle the tasks I need at the router level.

This is a fantastic router, and running OpenWRT on it instead of the default Linksys firmware opens up a lot of possibilities by being able to run Linux on the router, and add whatever functionality you might happen to need.

Posted by Jim at 2:47 PM | TrackBack

April 15, 2007

Firewall StartupItem part 2

One thing that's very important when setting up a new StartupItem like I did with my Firewall script is to make sure that the privledges are set correctly so that it actually runs at startup... The acticle I referenced didn't include this, but the reader comments at the end did. Specifically, the folder and enclosed items should be owned by root with group wheel with privs 755.

I had one question regarding the script and how I references the set of rules I wrote, the original article had these saved in /etc, which to me seemed a bit silly, having them in the same folder as the Startup script seemed much more logical. Here is my working script for this:


#!/bin/sh

##
# Firewall
##

. /etc/rc.common

StartService ()
{
if [ "${FIREWALL:=-NO-}" = "-YES-" ]
then
ConsoleMessage "Starting Firewall"
sh /Library/StartupItems/Firewall/fw.rules > /dev/null
fi
}

StopService ()
{
ConsoleMessage "Stopping Firewall"
/sbin/ipfw -f -q flush
}

RestartService ()
{
StopService
StartService
}

RunService "$1"

Posted by Jim at 9:55 PM | TrackBack