managedsoftwareupdate now records the date and result of the last check in /Library/Preferences/ManagedInstalls.plist. This is used by Managed Software Update.app.

git-svn-id: http://munki.googlecode.com/svn/trunk@237 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2009-09-29 17:17:09 +00:00
parent 299abe4f1c
commit 080ba42ca5
2 changed files with 11 additions and 1 deletions

View File

@@ -168,6 +168,16 @@ def main():
updatesavailable = False
if not options.installonly:
result = updatecheck.check(id=options.id)
# record last check date and result
nowString = munkicommon.NSDateNowString()
cmd = ['/usr/bin/defaults', 'write', '/Library/Preferences/ManagedInstalls',
'LastCheckDate', '-date', nowString]
retcode = subprocess.call(cmd)
cmd = ['/usr/bin/defaults', 'write', '/Library/Preferences/ManagedInstalls',
'LastCheckResult', '-int', str(result)]
retcode = subprocess.call(cmd)
if options.manualcheck:
munkistatus.quit()