idividebyzero Posted May 5, 2007 Share Posted May 5, 2007 Can you use Applescript to edit kexts? I know you can open terminal and run a command, but what happens when you sudo and have to verify the password? Does it just popup so you can enter the password and then go on its merry way? I believe there is a way to get terminal to change lines of text without having you manually select them with pico, is this correct? Ive seen people use "sudo perl" to automate the whole kext process which seems to replace certain strings by typing something like: 's/0x11111/0x22222/g' Tell Application "Terminal" Activate do script "sudo perl -pi -e 's/xx/xx/g' /system/etc" end tell Would that edit kexts? Im mostly confused about the perl commands, Ive only seen it in certain threads, I havent actually been able to use it with my hardware. Link to comment https://www.insanelymac.com/forum/topic/50262-use-applescript-to-edit-kexts/ Share on other sites More sharing options...
asap18 Posted May 6, 2007 Share Posted May 6, 2007 If you want something to run as a root user so you dont need to give the password you can use setuid to root on the script. Link to comment https://www.insanelymac.com/forum/topic/50262-use-applescript-to-edit-kexts/#findComment-360341 Share on other sites More sharing options...
x64tj Posted March 13, 2009 Share Posted March 13, 2009 You don't actually need to tell Terminal to do this. To run a shell command as root, all you need to do is: do shell script "whatever the command" with administrator priveleges This will prompt you with the standard OS X authentication dialog box. You can also specify the user and password if you're trying to script something specific to your computer. do shell script "command" user name "me" password "mypassword" with administrator privileges Link to comment https://www.insanelymac.com/forum/topic/50262-use-applescript-to-edit-kexts/#findComment-1105801 Share on other sites More sharing options...
Recommended Posts