From: Daniel Hokka Zakrisson Date: Sun, 24 Aug 2008 20:09:08 +0000 (+0000) Subject: If $3 is set, the run file is expected to be cleaned up if the context does X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6d43354a70999394feeffa77f2a3e4e3a2f3845;p=util-vserver.git 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 --- 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")