From f64176db21a599ae52b8fecc4b3db89e2ce1a737 Mon Sep 17 00:00:00 2001 From: David Prevot Date: Wed, 13 Dec 2023 15:47:55 +0100 Subject: [PATCH] Add IS_BACKPORTS_VERSION --- linux/evocheck.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux/evocheck.sh b/linux/evocheck.sh index f9c23d5..685bf1c 100755 --- a/linux/evocheck.sh +++ b/linux/evocheck.sh @@ -210,6 +210,13 @@ check_debiansecurity_lxc() { done fi } +check_backports_version() { + # Look for enabled "Debian Backports" sources from the "Debian" origin + apt-cache policy | grep "\bl=Debian Backports\b" | grep "\bo=Debian\b" | grep --quiet "\bc=main\b" + test $? -eq 1 || ( \ + apt-cache policy | grep "\bl=Debian Backports\b" | grep --quiet "\bn=${DEBIAN_RELEASE}-backports\b" && \ + test $? -eq 0 || failed "IS_BACKPORTS_VERSION" "Debian Backports enabled for another release than ${DEBIAN_RELEASE}" ) +} check_oldpub() { # Look for enabled pub.evolix.net sources (supersed by pub.evolix.org since Stretch) apt-cache policy | grep --quiet pub.evolix.net @@ -1553,6 +1560,7 @@ main() { test "${IS_SYSLOGCONF:=1}" = 1 && check_syslogconf test "${IS_DEBIANSECURITY:=1}" = 1 && check_debiansecurity test "${IS_DEBIANSECURITY_LXC:=1}" = 1 && check_debiansecurity_lxc + test "${IS_BACKPORTS_VERSION:=1}" = 1 && check_backports_version test "${IS_OLDPUB:=1}" = 1 && check_oldpub test "${IS_OLDPUB_LXC:=1}" = 1 && check_oldpub_lxc test "${IS_NEWPUB:=1}" = 1 && check_newpub