diff options
author | Mattia Rizzolo <mattia@debian.org> | 2017-05-21 15:26:28 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-05-21 19:46:45 +0200 |
commit | 3b848033295933b5af52b4cd88d09328d7a3cdfd (patch) | |
tree | beeea435cbf2477a995c9f265a3674b0932d52fc /hosts/profitbricks-build15-amd64/usr/local/bin/dsa-check-running-kernel | |
parent | ee64b8b9e1e57ec1c96a532711a3449680943516 (diff) | |
download | jenkins.debian.net-3b848033295933b5af52b4cd88d09328d7a3cdfd.tar.xz |
Update dsa-check-running-kernel from dsa-nagios (to support kernel 4.x as present in stretch)
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'hosts/profitbricks-build15-amd64/usr/local/bin/dsa-check-running-kernel')
-rwxr-xr-x | hosts/profitbricks-build15-amd64/usr/local/bin/dsa-check-running-kernel | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hosts/profitbricks-build15-amd64/usr/local/bin/dsa-check-running-kernel b/hosts/profitbricks-build15-amd64/usr/local/bin/dsa-check-running-kernel index 80f45bfb..aa6e35bd 100755 --- a/hosts/profitbricks-build15-amd64/usr/local/bin/dsa-check-running-kernel +++ b/hosts/profitbricks-build15-amd64/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 |