-
Notifications
You must be signed in to change notification settings - Fork 58
ScriptOverrides
You may wish to update a login-once
or login-privileged-once
item from time to time, and you may also want this item to be processed again for any users for whom the item has already been processed. One method to do so is to name the item accordingly (i.e. with a date or version in the name of the item itself), so that the item will be detected as having not been processed before. However, unless you remove the previous item, this may pose a problem for future users since you now have two items present that may have conflicting settings.
Support has been added for overriding login-once
or login-privileged-once
items. This will allow an admin to update an item in place, and then decide if that item will be processed only for future users on the system, or if it will also be processed for current users.
To add an item to the override array, create a postinstall with the following command to the pkg used to install the item. (One could also do this with a boot-once
script).
Note: If you do not provide a full path, Outset will automatically create the full path to the login-once
directory, i.e. /usr/local/outset/login-once/foo.sh
. To override an item in the login-privileged-once
directory, you must pass the full path of the items.
You can string as many items as you want:
/usr/local/outset/outset --add-override foo.sh --add-override /usr/local/outset/login-once/bar.mobileconfig --add-override /usr/local/outset/login-privileged-once/baz.pkg
Or, you can add them individually:
/usr/local/outset/outset --add-override foo.sh
/usr/local/outset/outset --add-override /usr/local/outset/login-once/bar.mobileconfig
/usr/local/outset/outset --add-override /usr/local/outset/login-privileged-once/baz.pkg
This will add a key to the preference file that will look similar to this:
<key>override_login_once</key>
<dict>
<key>/usr/local/outset/login-once/bar.mobileconfig</key>
<date>2016-12-30T22:14:31Z</date>
<key>/usr/local/outset/login-once/foo.sh</key>
<date>2016-12-30T22:14:31Z</date>
<key>/usr/local/outset/login-privileged-once/baz.pkg</key>
<date>2016-12-30T22:14:31Z</date>
</dict>
When Outset is invoked at subsequent logins, it will look in the run once plist relative to the context in which it is being run:
~/Library/Preferences/com.github.outset.once.plist
/usr/local/outset/share/com.github.outset.once.$UID.plist (where $UID is the UID of the console user)
If the item's timestamp in /usr/local/outset/share/com.chilcote.outset.plist
is newer, then the item will be processed again. If not, it will be skipped.
To remove an item from the overrides array, create a postinstall or boot-once
script that runs Outset with the --remove-override
argument. You can string as many scripts as you want:
/usr/local/outset/outset --remove-override foo.sh --remove-override /usr/local/outset/login-once/bar.mobileconfig --remove-override /usr/local/outset/login-privileged-once/baz.pkg
Or, you can remove them individually:
/usr/local/outset/outset --remove-override foo.sh
/usr/local/outset/outset --remove-override /usr/local/outset/login-once/bar.mobileconfig
/usr/local/outset/outset --remove-override /usr/local/outset/login-privileged-once/baz.pkg