From 0b93d8b8d24eb74235a718d010acc9ad745411b3 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Wed, 8 May 2024 13:40:33 +0200 Subject: [PATCH] avoid warning messages in cron logs Add -o Apt::Cmd::Disable-Script-Warning=true argument to the apt call, to avoid the "WARNING: apt does not have a stable CLI interface. Use with caution in scripts." messages that otherwise would be printed in the cron logs. --- misc/update-lxcs-cron.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/update-lxcs-cron.sh b/misc/update-lxcs-cron.sh index de5fded8..2782c504 100644 --- a/misc/update-lxcs-cron.sh +++ b/misc/update-lxcs-cron.sh @@ -22,7 +22,7 @@ function update_container() { alpine) pct exec "$container" -- ash -c "apk update && apk upgrade" ;; archlinux) pct exec "$container" -- bash -c "pacman -Syyu --noconfirm" ;; fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y update && dnf -y upgrade" ;; - ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt list --upgradable && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y" ;; + ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update 2>/dev/null | grep 'packages.*upgraded'; apt -o Apt::Cmd::Disable-Script-Warning=true list --upgradable && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y" ;; esac }