diff --git a/CASA-auth-token/server-java/Svc/linux/CasaAuthtokenSvcD.zen b/CASA-auth-token/server-java/Svc/linux/CasaAuthtokenSvcD.zen index f071a555..cf660f00 100644 --- a/CASA-auth-token/server-java/Svc/linux/CasaAuthtokenSvcD.zen +++ b/CASA-auth-token/server-java/Svc/linux/CasaAuthtokenSvcD.zen @@ -34,6 +34,7 @@ # Description: Start Casa Authtoken Service Daemon ### END INIT INFO +if [ -f /etc/SuSE-release ] ; then . /etc/rc.status # Shell functions sourced from /etc/rc.status: @@ -44,6 +45,33 @@ # rc_failed set local and overall rc status to failed # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status +else + _rc_status=0 + _rc_todo=$1 + + function rc_failed() { _rc_status=$1 ; } + + function rc_status() + { + if test "$_rc_todo" = "status" ; then + case "$_rc_status" in + 0) echo " [ running ]" ;; + 1|2) echo " [ dead ]" ;; + 3) echo " [ not running ]" ;; + *) echo " [ unknown ]" ;; + esac + else + case "$_rc_status" in + 0) echo " [ done ]" ;; + *) echo " [ failed ]" ;; + esac + fi + } + + function rc_reset() { _rc_status=0 ; } + + function rc_exit() { exit $_rc_status ; } +fi # First reset status of this service rc_reset