Created
August 20, 2015 13:26
-
-
Save poundbangbash/416f6679a9c110163c40 to your computer and use it in GitHub Desktop.
munki OnDemand example pkginfo
This file contains 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>OnDemand</key> | |
<true/> | |
<key>_metadata</key> | |
<dict> | |
<key>created_by</key> | |
<string>root</string> | |
<key>creation_date</key> | |
<date>2015-04-16T16:42:14Z</date> | |
<key>munki_version</key> | |
<string>2.2.4.2462</string> | |
<key>os_version</key> | |
<string>10.10.3</string> | |
</dict> | |
<key>autoremove</key> | |
<false/> | |
<key>catalogs</key> | |
<array> | |
<string>on-demand-test</string> | |
</array> | |
<key>category</key> | |
<string>SelfService</string> | |
<key>description</key> | |
<string>Attempts to sync time, if that fails attempts to sync against Apple's NTP.</string> | |
<key>developer</key> | |
<string>Me</string> | |
<key>display_name</key> | |
<string>Sync Time</string> | |
<key>installer_type</key> | |
<string>nopkg</string> | |
<key>minimum_os_version</key> | |
<string>10.4.0</string> | |
<key>name</key> | |
<string>SyncTime</string> | |
<key>postinstall_script</key> | |
<string>#!/bin/bash | |
echo "" | |
echo "======INTERNAL ATTEMPT======" | |
echo "Attempting to set time from ntp.internal.domain.com" | |
ntpdate -u ntp.internal.domain.com 2>&1 | |
if [ $? -eq 0 ]; | |
then | |
echo "======INTERAL SUCCESS======" | |
echo "" | |
exit 0 | |
else | |
echo "======INTERAL FAILED - EXTERNAL ATTEMPT======" | |
echo "Attempting to set time from time.apple.com" | |
ntpdate -u time.apple.com 2>&1 | |
if [ $? -eq 0 ]; | |
then | |
echo "======EXTERNAL SUCCESS======" | |
echo "" | |
exit 0 | |
else | |
echo "======EXTERNAL FAILED======" | |
echo "Time not changed" | |
echo "" | |
fi | |
fi | |
</string> | |
<key>unattended_install</key> | |
<true/> | |
<key>version</key> | |
<string>1.0</string> | |
</dict> | |
</plist> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment