Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/include/common.global.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2766 by niro, Tue Sep 29 11:59:31 2015 UTC revision 2767 by niro, Wed Feb 10 15:26:23 2016 UTC
# Line 402  nsslsay_queue_run_fingerprint() Line 402  nsslsay_queue_run_fingerprint()
402  {  {
403   nsslsay_fingerprint "$(nsslsay_queue_print)"   nsslsay_fingerprint "$(nsslsay_queue_print)"
404  }  }
405    
406    # read_cmdline "$variable"
407    # eg: read_cmdline "lang="
408    #       returns the value of the cmdline variable lang
409    # eg: read_cmdline "rd.info"
410    #      returns bool 1 if the variable was defined
411    #
412    read_cmdline()
413    {
414     local variable="$1"
415     local retval
416     local i
417    
418     if [[ -z ${variable} ]]
419     then
420     eecho "no variable given"
421     return 1
422     fi
423    
424     if [ ! -e /proc/cmdline ]
425     then
426     eecho "read_cmdline(): /proc/cmdline does not exists"
427     return 1
428     fi
429    
430     for i in $(</proc/cmdline)
431     do
432     if [[ ${i} = ${variable}* ]]
433     then
434     case ${variable} in
435     *=*) retval="${i#*=}" ;;
436     *) retval=1 ;; # bool
437     esac
438     fi
439     done
440    
441     echo "${retval}"
442     return 0
443    }

Legend:
Removed from v.2766  
changed lines
  Added in v.2767