diff options
Diffstat (limited to 'hosts/odu3a-armhf-rb/usr/local/bin/dsa-check-running-kernel')
-rwxr-xr-x | hosts/odu3a-armhf-rb/usr/local/bin/dsa-check-running-kernel | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hosts/odu3a-armhf-rb/usr/local/bin/dsa-check-running-kernel b/hosts/odu3a-armhf-rb/usr/local/bin/dsa-check-running-kernel index 80f45bfb..aa6e35bd 100755 --- a/hosts/odu3a-armhf-rb/usr/local/bin/dsa-check-running-kernel +++ b/hosts/odu3a-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 |