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 \
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user