Last active
September 4, 2020 13:32
-
-
Save joncrain/ba16fdc48849c5e4be88368a216fc491 to your computer and use it in GitHub Desktop.
NoPKG for Enabling NoMAD Login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>_metadata</key> | |
<dict> | |
<key>created_by</key> | |
<string>Jon Crain</string> | |
<key>creation_date</key> | |
<date>2020-09-3T18:05:47Z</date> | |
<key>munki_version</key> | |
<string>2.8.0.2810</string> | |
<key>os_version</key> | |
<string>10.14.6</string> | |
</dict> | |
<key>autoremove</key> | |
<false/> | |
<key>catalogs</key> | |
<array> | |
<string>testing</string> | |
</array> | |
<key>category</key> | |
<string>Scripts</string> | |
<key>description</key> | |
<string>Fix NoMAD Login after OS Upgrade or other auth change issue.</string> | |
<key>developer</key> | |
<string>Jon Crain</string> | |
<key>display_name</key> | |
<string>Enable NoMAD Login</string> | |
<key>icon_name</key> | |
<string></string> | |
<key>installcheck_script</key> | |
<string>#!/usr/bin/python | |
import subprocess | |
import sys | |
sys.path.insert(0, '/usr/local/munki') | |
from munkilib import FoundationPlist | |
def main(): | |
"""Main""" | |
try: | |
cmd = ["/usr/bin/security", "authorizationdb", "read", "system.login.console"] | |
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
stdout, _ = proc.communicate() | |
if stdout: | |
authdb = FoundationPlist.readPlistFromString(stdout) | |
except (IOError, OSError): | |
pass | |
mechs = authdb["mechanisms"] | |
for mech in mechs: | |
if "NoMADLogin" in mech: | |
sys.exit(1) | |
if __name__ == "__main__": | |
main()</string> | |
<key>installer_type</key> | |
<string>nopkg</string> | |
<key>minimum_os_version</key> | |
<string>10.4.0</string> | |
<key>name</key> | |
<string>NoMADLogin-Fix</string> | |
<key>postinstall_script</key> | |
<string>#!/bin/sh | |
/usr/local/bin/authchanger -reset -ad | |
</string> | |
<key>unattended_install</key> | |
<true/> | |
<key>unattended_uninstall</key> | |
<false/> | |
<key>uninstallable</key> | |
<true/> | |
<key>version</key> | |
<string>1.0</string> | |
<key>update_for</key> | |
<array> | |
<string>NoMAD LoginAD</string> | |
</array> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment