s!/etc/slackware-release!/etc/slackware-version! (reported by bubulak)
[util-vserver.git] / util-vserver / scripts / vprocunhide
index 04b6d0c..31c17f7 100755 (executable)
@@ -53,7 +53,7 @@ the GNU General Public License.  This program has absolutely no warranty."
 }
 
 
-while test "$1"; do
+while test -n "$1"; do
     case "$1" in
        --help)         showHelp;;
        --version)      showVersion;;
@@ -61,8 +61,8 @@ while test "$1"; do
 done
 
 findFile UNHIDEFILE \
-    "$CONFDIR"/.defaults/apps/vprocunhide/files \
-    "$PKGLIBDEFAULTDIR"/vprocunhide-files
+    "$__CONFDIR"/.defaults/apps/vprocunhide/files \
+    "$__PKGLIBDEFAULTDIR"/vprocunhide-files
 
 ok=1
 passed=
@@ -71,8 +71,8 @@ while read filename; do
 
     case "$filename" in
        (\#*)   continue;;
+       (\~*)   params=( --admin --watch --hide ); filename=${filename#\~};;
        (-*)    params=( --admin         --hide ); filename=${filename#-};;
-       (~*)    params=( --admin --watch --hide ); filename=${filename#~};;
        (:*)    params=(         --watch --hide ); filename=${filename#:};;
        (!*)    params=(                 --hide ); filename=${filename#!};;
        (+*)    params=(                --!hide ); filename=${filename#+};;
@@ -90,6 +90,6 @@ while read filename; do
     $_SETATTR -x "${params[@]}" "$@" &&        passed=1 || ok=
 done <"$UNHIDEFILE"
 
-test "$ok"     && exit 0 || \
-test "$passed" && exit 2 || \
+test -n "$ok"     && exit 0 || \
+test -n "$passed" && exit 2 || \
 exit 3