It's quite a simple task, but I'm failing on one point. I want to create a script connecting a VPN connection on boot, so my script looks like this:
tell application "Terminal"
do script "route add {censored}.{censored}.{censored}.{censored} -interface ppp0" (the {censored}... is the IP for which I want a static route)
end tell
The terminal of course replies "must be root to alter routing table".
If I say "sudo route add...", then I get a password prompt.
So, what do I need to do to run a script as root, but NOT writing a password in the script?
Thanks
Kosta
source
tell application "Terminal"
do script "route add {censored}.{censored}.{censored}.{censored} -interface ppp0" (the {censored}... is the IP for which I want a static route)
end tell
The terminal of course replies "must be root to alter routing table".
If I say "sudo route add...", then I get a password prompt.
So, what do I need to do to run a script as root, but NOT writing a password in the script?
Thanks
Kosta
source
Post a Comment