summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniele Sluijters <daenney@users.noreply.github.com>2015-04-22 14:17:32 +0200
committerDaniele Sluijters <daenney@users.noreply.github.com>2015-04-22 14:17:32 +0200
commit30bb4f4b7156ee4dbabf11e7063113e92e344d91 (patch)
treec47cfc038dce21ccb50e27818759db60de8ae4b5 /templates
parentb36c99ec02465f53b296a2d3ff8a86e2b825180f (diff)
unattended_upgrades: Only set MailOnError if true
When MailOnError is not set it will mail for everything by default so it only makes sense to have that key if we want it set to true.
Diffstat (limited to 'templates')
-rw-r--r--templates/unattended-upgrades.erb2
1 files changed, 2 insertions, 0 deletions
diff --git a/templates/unattended-upgrades.erb b/templates/unattended-upgrades.erb
index 3eb9230..6c24b71 100644
--- a/templates/unattended-upgrades.erb
+++ b/templates/unattended-upgrades.erb
@@ -40,10 +40,12 @@ Unattended-Upgrade::InstallOnShutdown "<%= @install_on_shutdown.to_s %>";
// 'mailx' must be installed.
Unattended-Upgrade::Mail "<%= @_mail['to'] %>";
+<%- if @_mail['only_on_error'] -%>
// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
Unattended-Upgrade::MailOnlyOnError "<%= @_mail['only_on_error'].to_s %>";
<%- end -%>
+<%- end -%>
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)