Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
The script in question:
https://gitlab.com/RiderExMachina/...
I need to know if elevations are necessary to remove the files in /Library/$FOLDER, and if so, how to implement it. -
I would guess at:
1. Depends on the individual perms/ownership of the thing you're trying to remove and the directory it lives in.
2. Either:
- run it with sudo
- make the script suid root (probably a bad idea and not sure it would work) (also, you'd need to add the hashbang at the beginning), or
- (if it was bash, but there may well be an equivalent) put a line at the beginning that checks if the 'whoami' command says 'root' and if not, have the script exec itself with sudo. -
@d4ng3r0u5
I was able to get it to run after writing some exception handling, however, I have to open the terminal and run it as "sudo python script.py; python script.py".
I might change the non-root stuff to before the root stuff, and then try to do privilege escalation.
Related Rants
I need people with Macs (running macOS) to help me make sure this Python script I wrote works. I'll upload it to git{hub, lab} and link to it in the comments.
question
would never usually ask for this...
macos
python
help needed
help wanted