From e5e6e3a2fe13935cd4ca80d274f7cb43bce56950 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 25 Feb 2012 10:44:49 +0100 Subject: [PATCH] script-functions: fix getbootparam/checkbootparam We should get rid of this annoying stuff and make sure we reduce it to a minimum and share what's inside grml-autoconfig. --- etc/grml/script-functions | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index 1786072..a39e3d8 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -76,8 +76,9 @@ stringinstring(){ # {{{ reread boot command line; echo last parameter's argument or return false. getbootparam(){ - stringinstring " $1=" /proc/cmdline || return 1 - result="${/proc/cmdline##*$1=}" + CMDLINE=$(cat /proc/cmdline) + stringinstring " $1=" "$CMDLINE" || return 1 + result="${CMDLINE##*$1=}" result="${result%%[ ]*}" echo "$result" return 0 @@ -86,7 +87,7 @@ getbootparam(){ # {{{ check boot commandline for specified option checkbootparam(){ - stringinstring " $1" /proc/cmdline + stringinfile " $1" /proc/cmdline return "$?" } # }}} -- 2.1.4