jamf / MakeMeAnAdmin

Provides temporary admin access for a standard user via Jamf Self Service
255 stars 65 forks source link

Issues with script #7

Open dstranathan opened 3 years ago

dstranathan commented 3 years ago
  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.)

jlevitsk commented 2 years ago

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.

jcejka11 commented 2 years ago

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.

jlevitsk commented 2 years ago

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