Hi,
I'm having some strange issues with launch daemons/agents and need some help.
I have a script which is to be run by a launch agent/daemon but the results are mixed.
The script should do the following:
- Compares a date in a file with todays date
- If the dates match or todays date is greater then it removes local admin of the user
- Jamf notify pops up and tells the user this has happened
- log files are removed and the launch daemon/agent is removed
- finish
Running the script from a launch agent does the following:
- Compares the dates
- Does not remove admin rights
- Jamf notify tells the user that admin rights have been removed
- Doesn't clean up any files
Running the script from a launch Daemon it does the following:
- Compares the dates
- Removes local admin rights form the user
- Does not run Jamf notify to tell the user
- Does not clean up any files
The script works perfect if run from terminal or run from a jamf policy.
What am I missing?? I don't mind running this from JAMF as a check in policy but it means the users device has to check in to have the local admin rights removed.
