From 30bb4f4b7156ee4dbabf11e7063113e92e344d91 Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Wed, 22 Apr 2015 14:17:32 +0200 Subject: 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. --- templates/unattended-upgrades.erb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'templates') 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) -- cgit v1.2.3