Skip to content

Instantly share code, notes, and snippets.

@nstrauss
Created October 1, 2018 02:14
Show Gist options
  • Save nstrauss/7cfbc5cb6e6bd9bdbe030d0325a92e80 to your computer and use it in GitHub Desktop.
Save nstrauss/7cfbc5cb6e6bd9bdbe030d0325a92e80 to your computer and use it in GitHub Desktop.

Revisions

  1. nstrauss created this gist Oct 1, 2018.
    31 changes: 31 additions & 0 deletions postinstall.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/bin/bash

    # Preference key reference
    # https://gitlab.com/orchardandgrove-oss/NoMADLogin-AD/wikis/Configuration/preferences
    domain="domain.com"
    background_image="/path/to/image.png"
    keychain_add="TRUE"
    logo="/path/to/logo.png"

    # Set default AD domain
    defaults write /Library/Preferences/menu.nomad.login.ad.plist ADDomain "$domain"

    # Set background image
    defaults write /Library/Preferences/menu.nomad.login.ad.plist BackgroundImage "$background_image"

    # Set login window logo
    defaults write /Library/Preferences/menu.nomad.login.ad.plist LoginLogo "$logo"

    # Adds a NoMAD entry into the keychain
    defaults write /Library/Preferences/menu.nomad.login.ad.plist KeychainAddNoMAD -bool "$keychain_add"

    # Should NoLo create a Keychain if none exists
    defaults write /Library/Preferences/menu.nomad.login.ad.plist KeychainCreate -bool "$keychain_add"

    # Set security authorization database mechanisms with authchanger
    /usr/local/bin/authchanger -reset -AD

    # Kill loginwindow process to force NoMAD Login to launch
    /usr/bin/killall -HUP loginwindow

    exit 0