macadmins / outset

Automatically process packages and scripts during boot, login, or on demand.
Apache License 2.0
150 stars 11 forks source link

On-Demand Script that triggers --login-Once does not write to preference file #36

Open miawri opened 1 year ago

miawri commented 1 year ago

As per https://github.com/macadmins/outset/wiki/OnDemand, if I create a script in the on-demand folder that fires a --login-once trigger as per below: -

"Include your script(s) in the respective /usr/local/outset/login-once/ or /usr/local/outset/login-every/ directory, and place a script in /usr/local/outset/on-demand/ that calls one or both of the above commands, it will loop through and process the scripts in the expected context."

The login-once items are processed successfully. However, the processing does not log this run to the preference file as is stated below: -

"This means, if your script was added to /usr/local/outset/login-once/ and you run the --login-once argument in your on demand script, then Outset will treat it like any other login-once item by processing it and logging it in the preference file so that subsequent logins won't run this script again."

This means that the new login-once script gets processed again at the next login so it ends up running again.

Running through the above scenario should add a run_once key for the script the was successfully triggered by the on-demand action.