vserver: Some more vserver-hashify-all cleanups.
[matthijs/servers/drsnuggles.git] / usr / local / bin / vserver-hashify-all
index d1a219089cddf597e601c69ca37465d76b41dc97..5df03c256d99b8ce5ecb86a094233a9b388f5e4e 100755 (executable)
@@ -3,9 +3,9 @@
 # The dir containing vserver configuration
 VSERVERS_CONF="/etc/vservers"
 
-for VDIR in $VSERVERS_CONF/*; do
+for VDIR in "$VSERVERS_CONF"/*; do
        NAME=`basename $VDIR`
-       # Check if its config dir exists
+       # Check if its a config dir
        if [ ! -d "$VDIR" ]; then
                continue;
        fi
@@ -20,6 +20,6 @@ echo "Cleaning up unused hashed files..."
 for HASH_DIR in "$VSERVERS_CONF"/.defaults/apps/vunify/hash/*; do
        if [ -L "$HASH_DIR" ]; then
                # All symbolic links 
-               sudo find -H "$HASH_DIR" -type f -links 1 -print0 | sudo xargs -0 rm
+               sudo find -H "$HASH_DIR" -type f -links 1 -print0 | sudo xargs --null --no-run-if-empty rm
        fi
 done