On 23/4/06 10:29 AM, "Paul Willemse" <[EMAIL PROTECTED]> wrote:

> Hi All,
> 
> I have several UNIX commands that needs to be run each time my Mac is
> started/restarted.
> 
> In terminal it looks like this:
> 
> su
> Password: (Root password)
> xxxx root# ipfw add 400 fwd 192.168.93.45,8080 tcp from any to
> 192.168.93.45 80
> 
> All this is to re-direct port 80 access to port 8080
> Any ideas? 

I meant to reply to this one days ago but forgot. Notice no-ones had a
crack. One way is to use the Applescript Editor (in the apps folder under
applescript). You can enter the required commands and then save the script
as an application and make it a log-in item. Here is a script I found on the
net for implementing a firewall rule which looks like it could be adapted
for your needs. It has the advantage that you can enter your credentials
thus preventing the need to interact with the script. I have the feeling
that possibly  sysctl or another command can be used with a switch to write
a route command like that to be loaded at startup but I'm not sure how to do
it. Perhaps someone else out there knows. In Linux you can routes to the
startup files so I'm sure it can be done in Mac OSX.
Here is the script. You can copy and paste it into script editor.

try
    set theConfirmation to (do shell script ¬
        "/sbin/ipfw add 0 deny tcp from any to any 3464" password ¬
        "YOURPASSWORDHERE" with administrator privileges)
    set theConfirmation to (do shell script ¬
        "/sbin/ipfw add 0 deny udp from any to any 2222" password ¬
        "YOURPASSWORDHERE" with administrator privileges)
on error
    beep
end try