From b7299ffca865ed03e5cf0e7ec5987d90ae8c344d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 3 Feb 2000 11:49:04 +0000 Subject: [PATCH] - functions run_cmd() and daemon() are returning proper values now svn-id: @633 --- rc.d/init.d/functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 82cfd6f8..d023d3fe 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -1,7 +1,7 @@ # functions This file contains functions to be used by most or all # shell scripts in the /etc/init.d directory. # -# $Id: functions,v 1.34 2000/01/31 14:30:11 misiek Exp $ +# $Id: functions,v 1.35 2000/02/03 11:49:04 misiek Exp $ # # Author: Miquel van Smoorenburg, # Hacked by: Greg Galloway and Marc Ewing @@ -127,6 +127,7 @@ deltext() # Usage run_cmd Message command_to_run run_cmd() { + exit_code=0 _ERRORS="" MESSAGE=$1 show "$MESSAGE"; busy @@ -135,8 +136,8 @@ run_cmd() deltext; ok else deltext; fail; [ -n "$_ERRORS" ] && echo $_ERRORS + exit_code=1 fi - exit_code=$? unset _ERRORS return $exit_code } @@ -153,6 +154,7 @@ action() daemon() { nicelevel=0 + exit_code=0 _ERRORS="" [ -z "$DEFAULT_SERVICE_RUN_NICE_LEVEL" ] && DEFAULT_SERVICE_RUN_NICE_LEVEL=0 # Test syntax. @@ -173,11 +175,13 @@ daemon() deltext ok else + exit_code=1 deltext fail [ -n "$_ERRORS" ] && echo $_ERRORS fi unset _ERRORS + return $exit_code } # A function to stop a program. -- 2.44.0