-
Notifications
You must be signed in to change notification settings - Fork 58
ExcludeUsers
If you want to exclude certain users from scripts that run in the login context (I.e. a local admin account or a static kiosk user), you can do so by editing the Outset preferences. You can do this two ways, either by bundling your own preference file or programmatically editing the existing one. To do the former, edit the example plist to include the users you want to ignore, and package this plist to be installed in /usr/local/outset/share/
. There isn't a provided way to create this package, because frankly you should do it programmatically.
Note: This only affects login-once
or login-every
scripts. on-demand
scripts can will still run in the current user context, even for excluded users.
To add a username you want to exclude, create a boot-once
script that runs Outset with the --add-ignored-user
argument. You can string as many users as you want:
/usr/local/outset/outset --add-ignored-user FOO --add-ignored-user BAR
Or, you can add them individually:
/usr/local/outset/outset --add-ignored-user FOO
/usr/local/outset/outset --add-ignored-user BAR
This will result in a preference file that will look similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ignored_users</key>
<array>
<string>FOO</string>
<string>BAR</string>
</array>
<key>network_timeout</key>
<integer>180</integer>
<key>wait_for_network</key>
<true/>
</dict>
</plist>
To remove a username from the array, create a boot-once
script that runs Outset with the --remove-ignored-user
argument. You can string as many users as you want:
/usr/local/outset/outset --remove-ignored-user FOO --remove-ignored-user BAR
Or, you can remove them individually:
/usr/local/outset/outset --remove-ignored-user FOO
/usr/local/outset/outset --remove-ignored-user BAR