MakeMeAnAdmin icon indicating copy to clipboard operation
MakeMeAnAdmin copied to clipboard

Issues with script

Open dstranathan opened this issue 3 years ago • 3 comments

  1. Whenever the LaunchDaemon ('removeAdmin.plist') loads, it errors with code 127. I have been observing it using the LaunchControl GUI tool. It appears to load/run, but then it definitely throws an error.

  2. After the workflow is done and the user account is demoted to a standard user again, the ‘removeAdminRights.sh’ script doesn’t delete the LaunchDaemon.

  3. The final step in which the script collects logs and saves them to an archive file. This step needs to be moved earlier in the script and the syntax needed to be changed.

Change syntax from: log collect --last 30m --output /private/var/userToRemove/$userToRemove.logarchive

To: log collect --output /private/var/userToRemove/$userToRemove.logarchive --last 30m

(Thanks to Brant Backes on Slack.)

dstranathan avatar Apr 07 '21 16:04 dstranathan

The delete issue you can fix by moving this line;

launchctl unload /Library/LaunchDaemons/removeAdmin.plist

Because the removeAdmin.sh will quit as soon as that command happens so move it 2 lines lower. At least that's what I found.

jlevitsk avatar Mar 18 '22 13:03 jlevitsk

The delete issue you can fix by moving this line;

launchctl unload /Library/LaunchDaemons/removeAdmin.plist

Because the removeAdmin.sh will quit as soon as that command happens so move it 2 lines lower. At least that's what I found.

Are you saying to run the launchctl unload at the very end? Thats would be 2 lines lower.

jcejka11 avatar Mar 24 '22 18:03 jcejka11

Above the "fi" line so it's still in the if condition.

jlevitsk avatar Mar 24 '22 19:03 jlevitsk