From 3b848033295933b5af52b4cd88d09328d7a3cdfd Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sun, 21 May 2017 15:26:28 +0200 Subject: Update dsa-check-running-kernel from dsa-nagios (to support kernel 4.x as present in stretch) Signed-off-by: Mattia Rizzolo Signed-off-by: Holger Levsen --- .../usr/local/bin/dsa-check-running-kernel | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'hosts/cbxi4pro0-armhf-rb') diff --git a/hosts/cbxi4pro0-armhf-rb/usr/local/bin/dsa-check-running-kernel b/hosts/cbxi4pro0-armhf-rb/usr/local/bin/dsa-check-running-kernel index 80f45bfb..aa6e35bd 100755 --- a/hosts/cbxi4pro0-armhf-rb/usr/local/bin/dsa-check-running-kernel +++ b/hosts/cbxi4pro0-armhf-rb/usr/local/bin/dsa-check-running-kernel @@ -57,12 +57,14 @@ get_avail() { # DSA uses kernel versions of the form 2.6.29.3-dsa-dl380-oldxeon, where # Debian uses versions of the form 2.6.29-2-amd64 - if [ "${kervers#3}" != "$kervers" ]; then - metavers=$(echo $kervers | sed -r -e 's/^3\.[0-9]+(\.[0-9])?+-[A-Za-z0-9\.]+-(.*)/\2/') - elif [ "${kervers//dsa}" != "$kervers" ]; then - metavers=$(echo $kervers | sed -r -e 's/^2\.(4|6)\.[0-9]+([\.0-9]+?)-(.*)/2.\1-\3/') + if [ "${kervers#2}" != "$kervers" ]; then + if [ "${kervers//dsa}" != "$kervers" ]; then + metavers=$(echo $kervers | sed -r -e 's/^2\.(4|6)\.[0-9]+([\.0-9]+?)-(.*)/2.\1-\3/') + else + metavers=$(echo $kervers | sed -r -e 's/^2\.(4|6)\.[0-9]+-[A-Za-z0-9\.]+-(.*)/2.\1-\2/') + fi else - metavers=$(echo $kervers | sed -r -e 's/^2\.(4|6)\.[0-9]+-[A-Za-z0-9\.]+-(.*)/2.\1-\2/') + metavers=$(echo $kervers | sed -r -e 's/^[0-9]+\.[0-9]+(\.[0-9])?+-[A-Za-z0-9\.]+-(.*)/\2/') fi # Attempt to track back to a metapackage failed. bail -- cgit v1.2.3-70-g09d2