Update configure auto updates method
Signed-off-by: Alban Vidal <alban.vidal@zordhak.fr>
This commit is contained in:
parent
57623a2cb8
commit
7d95af1423
@ -110,11 +110,24 @@ apt-get -y install \
|
||||
apt-listchanges \
|
||||
logrotate
|
||||
|
||||
################################################################################
|
||||
|
||||
# Configure auto updates
|
||||
sed -i \
|
||||
-e "s#^//Unattended-Upgrade::Mail .*#Unattended-Upgrade::Mail '$UNATTENDED_EMAIL';#" \
|
||||
-e 's#^//Unattended-Upgrade::MailOnlyOnError .*#Unattended-Upgrade::MailOnlyOnError "true";#' \
|
||||
/etc/apt/apt.conf.d/50unattended-upgrades
|
||||
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
|
||||
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
|
||||
git config --global user.name "$GIT_USERNAME"
|
||||
|
Loading…
Reference in New Issue
Block a user