Synthology Posted December 5, 2007 Share Posted December 5, 2007 Greetings, my current method for repairing permissions after a kext install is as follows: sudo chown -R root:wheel /System/Library/Extensions/ sudo chmod -R 755 /System/Library/Extensions/ sudo rm /System/Library/Extensions.mkext sudo rm /System/Library/Extensions.kextcache Can someone please enlighten me as to how I can get this as a terminal shell script, so I can just drag and drop it into terminal and it does the rest on its own? Thanks in advance. Link to comment Share on other sites More sharing options...
Ichixgo Posted December 5, 2007 Share Posted December 5, 2007 simply create a new text file e.g. with textedit and then begin it with the following expressions #!/bin/sh after that press returnand insert the code ^^ and safe the script as [scriptName].sh [scriptName] -> replace by what u want example code: #!/bin/sh echo Enter your root password sudo su echo You are now logged in as rootuser chown -R root:wheel /System/Library/Extensions/ chmod -R 755 /System/Library/Extensions/ rm /System/Library/Extensions.mkext rm /System/Library/Extensions.kextcache echo Success after that just safe the script somewhere and if u need it simply drag it into a clear terminal line wheres only the prompt ^^ and press enter if your terminal is actually in the same directory as the script simply type ./[scriptName].sh ^^ greetz Ichixgo Link to comment Share on other sites More sharing options...
Synthology Posted December 5, 2007 Author Share Posted December 5, 2007 Excellent, thank you my friend. This will certainly save some time, and now a days, time is precious. Cheers simply create a new text file e.g. with texteditand then begin it with the following expressions #!/bin/sh after that press returnand insert the code ^^ and safe the script as [scriptName].sh [scriptName] -> replace by what u want example code: #!/bin/sh echo Enter your root password sudo su echo You are now logged in as rootuser chown -R root:wheel /System/Library/Extensions/ chmod -R 755 /System/Library/Extensions/ rm /System/Library/Extensions.mkext rm /System/Library/Extensions.kextcache echo Success after that just safe the script somewhere and if u need it simply drag it into a clear terminal line wheres only the prompt ^^ and press enter if your terminal is actually in the same directory as the script simply type ./[scriptName].sh ^^ greetz Ichixgo Link to comment Share on other sites More sharing options...
New2OSx Posted December 5, 2007 Share Posted December 5, 2007 simply create a new text file e.g. with texteditand then begin it with the following expressions #!/bin/sh after that press returnand insert the code ^^ and safe the script as [scriptName].sh [scriptName] -> replace by what u want example code: #!/bin/sh echo Enter your root password sudo su echo You are now logged in as rootuser chown -R root:wheel /System/Library/Extensions/ chmod -R 755 /System/Library/Extensions/ rm /System/Library/Extensions.mkext rm /System/Library/Extensions.kextcache echo Success after that just safe the script somewhere and if u need it simply drag it into a clear terminal line wheres only the prompt ^^ and press enter if your terminal is actually in the same directory as the script simply type ./[scriptName].sh ^^ greetz Ichixgo Thx alot, but there is anyway to auto provide root password and how to trap an error/s or message. e.g. : "There is/are no such file/s to remove" or "file not found to remove". Once again Thax in advance! Link to comment Share on other sites More sharing options...
Synthology Posted December 5, 2007 Author Share Posted December 5, 2007 After I created the script, it always gives me an error - Permission Denied - Perhaps I missed a detail somewhere. Again, any help is most appreciated. Cheers Link to comment Share on other sites More sharing options...
adenoski Posted December 5, 2007 Share Posted December 5, 2007 After I created the script, it always gives me an error - Permission Denied -Perhaps I missed a detail somewhere. Again, any help is most appreciated. Cheers After creating a script like that, you'd want to make it executable so you can run it. Do the following and you should be able to execute the script afterwards. chmod +x [scriptname].sh where [scriptname] is your script Link to comment Share on other sites More sharing options...
Synthology Posted December 6, 2007 Author Share Posted December 6, 2007 adenoski, The chmod +x definitely worked. It was exactly what I was looking for. Thanks allot matey, good call. Cheers Link to comment Share on other sites More sharing options...
Recommended Posts