added lots of new flags
[util-vserver.git] / util-vserver / scripts / functions
index 66c3bd3..e794173 100644 (file)
@@ -402,7 +402,7 @@ function _getProcNumberCount
        set -- $($_GREP '^PROC:' "/proc/virtual/$1/limit" 2>/dev/null)
        procnr_cnt=$2
     else
-       procnr_cnt=$($_VPS ax | $_AWK '{print $2}' | $_GREP -x "$_ctx" | $_WC -l )
+       procnr_cnt=$($_VPS ax | $_AWK '{print $2}' | $_GREP -x "$1" | $_WC -l )
     fi
 
     let procnr_cnt=procnr_cnt+0
@@ -452,11 +452,16 @@ function isVserverRunning
     return 0
 }
 
-## Called as 'getFileValue <varname> <filename>'
+## Called as 'getFileValue <varname> <filename>+'
 function getFileValue
 {
-    test -r "$2" || return 0
-    eval read "$1" <"$2"
+    local var=$1
+    local file
+    shift
+
+    findFile file "$@" ''
+    test "$file" -a -r "$file" || return 0
+    eval read "$var" <"$file"
 }
 
 ## Called as 'getFileArray <varname> <filename>'