Update configure auto updates method

Signed-off-by: Alban Vidal <alban.vidal@zordhak.fr>
This commit is contained in:
Alban Vidal 2018-05-15 17:27:13 +00:00
parent 57623a2cb8
commit 7d95af1423

View File

@ -110,11 +110,24 @@ apt-get -y install \
apt-listchanges \ apt-listchanges \
logrotate logrotate
################################################################################
# Configure auto updates # Configure auto updates
sed -i \ UNA_FILE="/etc/apt/apt.conf.d/50unattended-upgrades"
-e "s#^//Unattended-Upgrade::Mail .*#Unattended-Upgrade::Mail '$UNATTENDED_EMAIL';#" \ # email setting
-e 's#^//Unattended-Upgrade::MailOnlyOnError .*#Unattended-Upgrade::MailOnlyOnError "true";#' \ if ! grep -q '^Unattended-Upgrade::Mail ' $UNA_FILE ; then
/etc/apt/apt.conf.d/50unattended-upgrades 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
else
sed -i "s/Unattended-Upgrade::MailOnlyOnError .*/Unattended-Upgrade::MailOnlyOnError 'true';/" $UNA_FILE
fi
################################################################################
# Set git global config # Set git global config
git config --global user.name "$GIT_USERNAME" git config --global user.name "$GIT_USERNAME"