Mac_Goddess
asked on
Script to add line to ipfw.conf file
I need to find a way to add a line to the /usr/local/etc/ipfw.conf file.
What I thought would be an easy script is giving me headaches and I am hoping one of you can point me in the right direction?
This is what I want it to do:
cd /usr/local/etc/
sudo vi ipfw.conf
i
add 00050 allow udp from any to any src-port 67 dist-port 68 in
esc
:wq
This is the script I've written.....
do shell script "cd /usr/local/etc/; vi ipfw.conf; i; 'add 00050 allow udp from any to any src-port 67 dist-port 68 in'; ^V ESC; :wq" with administrator privileges
It seems to be hanging on the ^V ESC
Would there be a better way to accomplish this task?
What I thought would be an easy script is giving me headaches and I am hoping one of you can point me in the right direction?
This is what I want it to do:
cd /usr/local/etc/
sudo vi ipfw.conf
i
add 00050 allow udp from any to any src-port 67 dist-port 68 in
esc
:wq
This is the script I've written.....
do shell script "cd /usr/local/etc/; vi ipfw.conf; i; 'add 00050 allow udp from any to any src-port 67 dist-port 68 in'; ^V ESC; :wq" with administrator privileges
It seems to be hanging on the ^V ESC
Would there be a better way to accomplish this task?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER