update listupgrade from upstream
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jérémy Lecour 2020-02-27 13:41:04 +01:00 committed by Jérémy Lecour
parent d31dddc9aa
commit 1b29f2d793
2 changed files with 27 additions and 8 deletions

View file

@ -54,6 +54,7 @@ The **patch** part changes incrementally at each release.
* evomaintenance: Turn on API by default (instead of DB) * evomaintenance: Turn on API by default (instead of DB)
* evomaintenance: upstream version 0.6.0 * evomaintenance: upstream version 0.6.0
* evomaintenance: install PG dependencies only when needed * evomaintenance: install PG dependencies only when needed
* listupgrade: update from upstream
* lxc-php: refactor tasks for better maintainability * lxc-php: refactor tasks for better maintainability
* lxc: rely on lxc_container module instead of command module * lxc: rely on lxc_container module instead of command module
* lxc: remove useless loop in apt execution * lxc: remove useless loop in apt execution

View file

@ -78,7 +78,13 @@ if [[ "$1" != "--cron" ]]; then
fi fi
# Update APT cache and get packages to upgrade and packages on hold. # Update APT cache and get packages to upgrade and packages on hold.
apt -q2 update 2>&1 | (egrep -ve '^(Listing|WARNING|$)' -e upgraded -e 'up to date' || true ) aptUpdateOutput=$(apt update 2>&1 | (egrep -ve '^(Listing|WARNING|$)' -e upgraded -e 'up to date' || true ))
if (echo "$aptUpdateOutput" | egrep "^Err(:[0-9]+)? http"); then
echo "FATAL - Not able to fetch all sources (probably a pesky (mini)firewall). Please, fix me"
exit 100
fi
apt-mark showhold > $packagesHold apt-mark showhold > $packagesHold
apt list --upgradable 2>&1 | grep -v -f $packagesHold | egrep -v '^(Listing|WARNING|$)' > $packages apt list --upgradable 2>&1 | grep -v -f $packagesHold | egrep -v '^(Listing|WARNING|$)' > $packages
packagesParsable=$(cut -f 1 -d / <$packages |tr '\n' ' ') packagesParsable=$(cut -f 1 -d / <$packages |tr '\n' ' ')
@ -140,9 +146,9 @@ for pkg in $packagesParsable; do
elif echo "$pkg" |grep -qE "^tomcat[[:digit:]]+$"; then elif echo "$pkg" |grep -qE "^tomcat[[:digit:]]+$"; then
echo "Tomcat" >>$servicesToRestart echo "Tomcat" >>$servicesToRestart
elif [ "$pkg" = "redis-server" ]; then elif [ "$pkg" = "redis-server" ]; then
echo "redis-server" >>$servicesToRestart echo "Redis" >>$servicesToRestart
elif [ "$pkg" = "mongodb-server" ]; then elif [ "$pkg" = "mongodb-server" ]; then
echo "redis-server" >>$servicesToRestart echo "MondoDB" >>$servicesToRestart
elif echo "$pkg" |grep -qE "^courier-(pop|imap)"; then elif echo "$pkg" |grep -qE "^courier-(pop|imap)"; then
echo "Courier POP/IMAP" >>$servicesToRestart echo "Courier POP/IMAP" >>$servicesToRestart
elif echo "$pkg" |grep -qE "^dovecot-(pop|imap)d"; then elif echo "$pkg" |grep -qE "^dovecot-(pop|imap)d"; then
@ -161,15 +167,19 @@ for pkg in $packagesParsable; do
echo "Varnish" >>$servicesToRestart echo "Varnish" >>$servicesToRestart
elif [ "$pkg" = "squid" ]; then elif [ "$pkg" = "squid" ]; then
echo "Squid" >>$servicesToRestart echo "Squid" >>$servicesToRestart
elif [ "$pkg" = "elasticsearch" ]; then
echo "Elasticsearch" >>$servicesToRestart
elif [ "$pkg" = "logstash" ]; then
echo "Logstash" >>$servicesToRestart
elif [ "$pkg" = "libc6" ]; then elif [ "$pkg" = "libc6" ]; then
echo "Tous les services (mise à jour de libc6)." >$servicesToRestart echo "Tous les services sont susceptibles d'être redémarrés (mise à jour de libc6)." >$servicesToRestart
break break
elif [ "$pkg" = "libstdc++6" ]; then elif [ "$pkg" = "libstdc++6" ]; then
echo "Tous les services (mise à jour de libstdc++6)." >$servicesToRestart echo "Tous les services sont susceptibles d'être redémarrés (mise à jour de libstdc++6)." >$servicesToRestart
break break
elif echo "$pkg" |grep -q "^libssl"; then elif echo "$pkg" |grep -q "^libssl"; then
echo "Tous les services (mise à jour de libssl)." >$servicesToRestart echo "Tous les services sont susceptibles d'être redémarrés (mise à jour de libssl)." >$servicesToRestart
break break
fi fi
done done
@ -215,8 +225,16 @@ tôt possible.
Cordialement, Cordialement,
-- --
Équipe Evolix <equipe@evolix.fr> Équipe Evolix - Hébergement et Infogérance Open Source
Evolix - Hébergement et Infogérance Open Source http://www.evolix.fr/ http://evolix.com | Twitter: @Evolix @EvolixNOC | http://blog.evolix.com
EOT EOT
<$template /usr/sbin/sendmail $mailto <$template /usr/sbin/sendmail $mailto
# Now we try to fetch all the packages for the next update session
downloadstatus=$(apt dist-upgrade --assume-yes --download-only -q2 2>&1)
echo "$downloadstatus" | grep -q 'Download complete and in download only mode'
if [ $? -ne 0 ]; then
echo "$downloadstatus"
fi;