Skip to content
Elliot Nevills edited this page Jun 21, 2024 · 6 revisions

Login-Once Overrides

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.

Outset supports 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.

Adding Items to Override

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 or via some MDM deployment process).

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/io.macadmins.Outset.plist
/Library/Preferences/io.macadmins.Outset.plist run_once-<username> (where <username> is the user name of the console user)

If the item's timestamp is newer, then the item will be processed again. If not, it will be skipped.

Removing Scripts

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.sh --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.sh
/usr/local/outset/outset --remove-override /usr/local/outset/login-privileged-once/baz.pkg