Last active
August 29, 2015 14:23
-
-
Save fuzzylogiq/fadbc9716275b4466086 to your computer and use it in GitHub Desktop.
Pre & Postflights for munki to call jamf recon only if managedsoftwareupdate has installed or removed
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
#!/bin/bash | |
ORCHARD_DEFAULTS=/Library/Preferences/uk.ac.ox.it.orchard | |
MUNKI_DEFAULTS=/Library/Preferences/ManagedInstalls | |
LOG_FILE=$(defaults read "${MUNKI_DEFAULTS}" LogFile) | |
LOG_DIR=$(dirname "${LOG_FILE}") | |
INSTALL_LOG_MTIME=$(stat -f "%m" "${LOG_DIR}/Install.log") | |
# Only run jamf recon if an Install/Removal has taken place | |
if [ $(defaults read "${ORCHARD_DEFAULTS}" InstallLogMtime) -ne $INSTALL_LOG_MTIME ];then | |
/usr/sbin/jamf recon > /dev/null 2>&1 & | |
fi |
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
#!/bin/bash | |
ORCHARD_DEFAULTS=/Library/Preferences/uk.ac.ox.it.orchard | |
MUNKI_DEFAULTS=/Library/Preferences/ManagedInstalls | |
LOG_FILE=$(defaults read "${MUNKI_DEFAULTS}" LogFile) | |
LOG_DIR=$(dirname "${LOG_FILE}") | |
INSTALL_LOG_MTIME=$(stat -f "%m" "${LOG_DIR}/Install.log") | |
defaults write "${ORCHARD_DEFAULTS}" InstallLogMtime "${INSTALL_LOG_MTIME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment