mirror of
https://github.com/munki/munki.git
synced 2026-04-22 20:48:36 -05:00
Add support for new preferences "SuppressUserNotification" and "SuppressAutoInstall".
SuppressUserNotification prevents munki from notifying a logged-in user of available updates. SuppressAutoInstall prevents munki from automatically installing when at the loginwindow. git-svn-id: http://munki.googlecode.com/svn/trunk@606 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -549,8 +549,12 @@ def main():
|
||||
if not munkicommon.currentGUIusers():
|
||||
# no GUI users
|
||||
if getIdleSeconds() > 10:
|
||||
# no GUI users, system is idle, so install
|
||||
mustrestart = doInstallTasks()
|
||||
if not munkicommon.pref('SuppressAutoInstall'):
|
||||
# no GUI users, system is idle, so install
|
||||
mustrestart = doInstallTasks()
|
||||
else:
|
||||
munkicommon.log("Skipping auto install because "
|
||||
"SuppressAutoInstall is true.")
|
||||
else:
|
||||
# there are GUI users
|
||||
consoleuser = munkicommon.getconsoleuser()
|
||||
@@ -559,9 +563,12 @@ def main():
|
||||
# the loginwindow due to fast user switching
|
||||
# so do nothing
|
||||
pass
|
||||
else:
|
||||
elif munkicommon.pref('SuppressUserNotification'):
|
||||
# notify the current console user
|
||||
notifyUserOfUpdates()
|
||||
else:
|
||||
munkicommon.log("Skipping user notification because "
|
||||
"SuppressUserNotification is true.")
|
||||
elif not options.quiet:
|
||||
print ("\nRun %s --installonly to install the downloaded "
|
||||
"updates." % myname)
|
||||
|
||||
@@ -501,8 +501,9 @@ def prefs():
|
||||
_prefs['SoftwareUpdateServerURL'] = ''
|
||||
_prefs['DaysBetweenNotifications'] = 1
|
||||
_prefs['LastNotifiedDate'] = '1970-01-01 00:00:00 -0000'
|
||||
# Added by bcw
|
||||
_prefs['UseClientCertificate'] = False
|
||||
_prefs['SuppressUserNotification'] = False
|
||||
_prefs['SuppressAutoInstall'] = False
|
||||
|
||||
prefsfile = "/Library/Preferences/ManagedInstalls.plist"
|
||||
pl = {}
|
||||
|
||||
Reference in New Issue
Block a user