Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

michaelzz

macrumors newbie
Original poster
Apr 4, 2008
11
0
Hi,
I have 2 commands in terminal i use often and I would like to automate them with an applescript (or shell script, or a script of some sort). I tried apple script and put this in

Code:
do shell script "sudo ipfw pipe 1 config bw 50KByte/s"
do shell script "sudo ipfw add 1 pipe 1 src-port 80"
then i try to run it in the editor and it says "error: Password: ". so i was wondering if there was someway to add a password into the script (i don't care too much about security), or find a way around this. I would rather not type my password every time i try to run the script, but it would be fine if I had to.
Thanks in advance!
 

michaelzz

macrumors newbie
Original poster
Apr 4, 2008
11
0
i got an error after i did that
Code:
ipfw: socket: operation not permitted
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
Well I'm sorry, I don't know anything about that error, but using those keywords is the normal way to do such things from AppleScript. Maybe certain commands have issues with it. Can you try running the script from the root account and see if it still gives you the error?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.