From 3278ca86769d4c609310caad30e46a93589e715f Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Mon, 2 Nov 2009 19:57:56 +0100 Subject: [PATCH] Use grml-core for boot params --- debian/control | 2 +- sh-lib | 28 +++++----------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/debian/control b/debian/control index b27c85c..460a3c6 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Vcs-Browser: http://git.grml.org/?p=grml-shlib.git Package: grml-shlib Architecture: all -Depends: ${misc:Depends}, procps, net-tools, iproute +Depends: ${misc:Depends}, procps, net-tools, iproute, grml-core Conflicts: sh-lib Replaces: sh-lib Description: Generic shell library used in grml scripts diff --git a/sh-lib b/sh-lib index 1975585..c9fa8d0 100644 --- a/sh-lib +++ b/sh-lib @@ -6,6 +6,8 @@ # License: This file is licensed under the GPL v2. ################################################################################ +. /usr/lib/grml/core.sh + # VARIABLES {{{ VERBOSE__=0 VERBOSE_TMP__=0 @@ -25,8 +27,6 @@ EXIT_FUNCTION__="_syslog" # function to call upon die (can be set by user) SYSLOG__="YES" -CMD_LINE__="" # /proc/cmdline - LANG__="$LANG" LC_ALL__="$LC_ALL" LANGUAGE__="$LANGUAGE" @@ -411,20 +411,14 @@ stringInString() # get value for bootparam given as first param getBootParam() { - local param_to_search_="$1" - local result_='' - - stringInString " $param_to_search_=" "$CMD_LINE__" || return 1 - result_="${CMD_LINE__##*$param_to_search_=}" - result_="${result_%%[ ]*}" - echo "$result_" - return 0 + getbootparam $1 + return "$?" } # Check boot commandline for specified option checkBootParam() { - stringInString " $1" "$CMD_LINE__" + checkbootparam $1 return "$?" } # }}} @@ -715,18 +709,6 @@ _checkExecutables() _checkExecutables -_checkBootParam() -{ - local path_="/proc/cmdline" - if [ -e "$path_" ]; then - CMD_LINE__=`execute "cat $path_" warnLog` - return 0 - fi - warnLog "$path_ does not exist, thus sh-lib may not work reliable!" - return 1 -} -_checkBootParam - _setDebugLevel() { # accept only integer as arguments -- 2.1.4