Fix Unattended-Upgrade
Signed-off-by: Alban Vidal <alban.vidal@zordhak.fr>
This commit is contained in:
parent
73796e018a
commit
2f440ebbda
@ -125,15 +125,15 @@ apt-get -y install \
|
|||||||
UNA_FILE="/etc/apt/apt.conf.d/50unattended-upgrades"
|
UNA_FILE="/etc/apt/apt.conf.d/50unattended-upgrades"
|
||||||
# email setting
|
# email setting
|
||||||
if ! grep -q '^Unattended-Upgrade::Mail ' $UNA_FILE ; then
|
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
|
else
|
||||||
sed -i "s/Unattended-Upgrade::Mail .*/Unattended-Upgrade::Mail '$UNATTENDED_EMAIL';/" $UNA_FILE
|
sed -i "s/Unattended-Upgrade::Mail .*/Unattended-Upgrade::Mail '$UNATTENDED_EMAIL';/" $UNA_FILE
|
||||||
fi
|
fi
|
||||||
# MailOnlyOnError
|
# MailOnlyOnError
|
||||||
if ! grep -q '^Unattended-Upgrade::MailOnlyOnError ' $UNA_FILE ; then
|
if ! grep -q '^Unattended-Upgrade::MailOnlyOnError ' $UNA_FILE ; then
|
||||||
echo "Unattended-Upgrade::MailOnlyOnError 'true';" >> $UNA_FILE
|
echo "Unattended-Upgrade::MailOnlyOnError \"true\";" >> $UNA_FILE
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user