Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with script #7

Open
dstranathan opened this issue Apr 7, 2021 · 3 comments
Open

Issues with script #7

dstranathan opened this issue Apr 7, 2021 · 3 comments

Comments

@dstranathan
Copy link

  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
Copy link

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants