Make kernel version detection work with non-standard version naming such as found on OpenWRT

This commit is contained in:
Tom Eastep 2009-12-06 10:42:28 -08:00
parent c8616d4c67
commit 7a6ad80c8a

View File

@ -79,7 +79,7 @@ COMMAND="$1"
[ -n "${PRODUCT:=Shorewall6}" ]
kernel=$(printf "%2d%02d%02d\n" $(echo $(uname -r) 2> /dev/null | sed 's/-.*//' | tr '.' ' ' ) | head -n1)
kernel=$(printf "%2d%02d%02d" $(uname -r 2> /dev/null | sed -e 's/-.*//' -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/\1 \2 \3/g'))
if [ $kernel -lt 20624 ]; then
error_message "ERROR: $PRODUCT requires Linux kernel 2.6.24 or later"
status=2