Fix Unattended-Upgrade

Signed-off-by: Alban Vidal <alban.vidal@zordhak.fr>
This commit is contained in:
Alban Vidal 2019-02-19 06:48:38 +01:00
parent 73796e018a
commit 2f440ebbda

View File

@ -125,15 +125,15 @@ apt-get -y install \
UNA_FILE="/etc/apt/apt.conf.d/50unattended-upgrades"
# email setting
if ! grep -q '^Unattended-Upgrade::Mail ' $UNA_FILE ; then
echo "Unattended-Upgrade::Mail '$UNATTENDED_EMAIL';" >> $UNA_FILE
echo "Unattended-Upgrade::Mail \"$UNATTENDED_EMAIL\";" >> $UNA_FILE
else
sed -i "s/Unattended-Upgrade::Mail .*/Unattended-Upgrade::Mail '$UNATTENDED_EMAIL';/" $UNA_FILE
fi
# MailOnlyOnError
if ! grep -q '^Unattended-Upgrade::MailOnlyOnError ' $UNA_FILE ; then
echo "Unattended-Upgrade::MailOnlyOnError 'true';" >> $UNA_FILE
echo "Unattended-Upgrade::MailOnlyOnError \"true\";" >> $UNA_FILE
else
sed -i "s/Unattended-Upgrade::MailOnlyOnError .*/Unattended-Upgrade::MailOnlyOnError 'true';/" $UNA_FILE
sed -i "s/Unattended-Upgrade::MailOnlyOnError .*/Unattended-Upgrade::MailOnlyOnError \"true\";/" $UNA_FILE
fi
################################################################################