--- trunk/magellan-initscripts/etc/rc.d/init.d/functions 2005/10/21 15:21:41 274 +++ trunk/magellan-initscripts/etc/rc.d/init.d/functions 2007/07/21 19:23:16 505 @@ -1,5 +1,5 @@ #!/bin/bash -# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/functions,v 1.5 2005-10-21 15:21:41 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/functions,v 1.7 2007-07-21 19:23:16 niro Exp $ # Begin $rc_base/init.d/functions - Run Level Control Functions @@ -137,16 +137,17 @@ evaluate_retval() { - error_value=$? + local error_value="$1" + [[ -z ${error_value} ]] && error_value=$? - if [ $error_value = 0 ] + if [[ ${error_value} = 0 ]] then print_status success else print_status failure fi - return $error_value + return ${error_value} } print_status() @@ -348,14 +349,20 @@ fi } +kernel_version() +{ + local KV="$(uname -r | cut -d- -f1)" + echo "${KV}" +} + kernel_major_version() { local KV - KV="$(uname -r|cut -d. -f1-2)" + KV="$(uname -r | cut -d. -f1-2)" echo "${KV}" } -dolisting() +dolisting() { local x= local y=