diff --git a/CHANGELOG.md b/CHANGELOG.md index 6308d4d0..ba2e762a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The **patch** part changes incrementally at each release. * cerbot: use the legacy script on Debian 8 and 9 * evoacme: upstream release 21.01 * evolinux-users: Add sudo rights for nagios for multi-php lxc +* listupgrade: update script from upstream * minifirewall: change some defaults * nagios-nrpe: update check_phpfpm_status.pl & install perl dependencies * redis: use /run instead or /var/run diff --git a/listupgrade/files/listupgrade.sh b/listupgrade/files/listupgrade.sh index ad04c8ee..d2f4996b 100644 --- a/listupgrade/files/listupgrade.sh +++ b/listupgrade/files/listupgrade.sh @@ -238,3 +238,27 @@ echo "$downloadstatus" | grep -q 'Download complete and in download only mode' if [ $? -ne 0 ]; then echo "$downloadstatus" fi; + + +# Also, we try to update each container apt sources +if which lxc-ls > /dev/null; then + for container in $(lxc-ls); do + + aptUpdateOutput=$(lxc-attach -n $container -- 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 CONTAINER - Not able to fetch all sources (probably a pesky (mini)firewall). Please, fix me" + exit 150 + fi + + # Now we try to fetch all the packages for the next update session + downloadstatus=$(lxc-attach -n $container -- 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; + + done +fi +