From 7a6ad80c8ac76b202ed5b2eae7ee221e30cf858f Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 6 Dec 2009 10:42:28 -0800 Subject: [PATCH] Make kernel version detection work with non-standard version naming such as found on OpenWRT --- Shorewall/Perl/prog.footer6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shorewall/Perl/prog.footer6 b/Shorewall/Perl/prog.footer6 index f41bef680..f7b458983 100644 --- a/Shorewall/Perl/prog.footer6 +++ b/Shorewall/Perl/prog.footer6 @@ -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