From c6d43354a70999394feeffa77f2a3e4e3a2f3845 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sun, 24 Aug 2008 20:09:08 +0000 Subject: [PATCH] If $3 is set, the run file is expected to be cleaned up if the context does not exist. Fix the previous change to handle this correctly. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2770 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- scripts/functions | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/functions b/scripts/functions index 224e440..7b31944 100644 --- a/scripts/functions +++ b/scripts/functions @@ -601,12 +601,16 @@ function getVserverStatus read _gvs_ctx <"$1"/run eval "$2"=\$_gvs_ctx - test "$1" = "$($_VUNAME -g --xid "$_gvs_ctx" context)" || return 1 - - test -n "$3" || return 0 - local _gvs_tmp - _getProcNumberCount "$_gvs_ctx" _gvs_tmp - eval "$3"=\$_gvs_tmp + if test "$1" = "$($_VUNAME -g --xid "$_gvs_ctx" context)"; then + test -n "$3" || return 0 + local _gvs_tmp + _getProcNumberCount "$_gvs_ctx" _gvs_tmp + eval "$3"=\$_gvs_tmp + else + test -n "$3" || return 1 + eval "$3"=0 + _gvs_tmp=0 + fi if test "$_gvs_tmp" = 0; then local runfile=$($_READLINK "$1/run") -- 1.8.1.5