Minor fixes to 01.reclock eventscript.
authorMartin Schwenke <martin@meltin.net>
Wed, 30 Sep 2009 11:21:56 +0000 (21:21 +1000)
committerMartin Schwenke <martin@meltin.net>
Wed, 30 Sep 2009 11:21:56 +0000 (21:21 +1000)
test -z really needs its argument to be quoted.  Simplified a status
test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit fe26da7780545b1ecc0a7da5bc1cf8beaeea94cc)

ctdb/config/events.d/01.reclock

index d27d8024fba13c043e55343abb9bb50defdbb45c..74b9ceac8686e071f95fc41f8b7bf83c5fb6409a 100755 (executable)
@@ -29,7 +29,7 @@ case $cmd in
        }
 
        RECLOCKFILE=`ctdb -Y getreclock`
-       [ -z $RECLOCKFILE ] && {
+       [ -z "$RECLOCKFILE" ] && {
                # we are not using a reclock file
                ctdb_counter_init "$RECLOCKCOUNT"
                exit 0
@@ -38,8 +38,7 @@ case $cmd in
        # try stat the reclock file as a background process
        # so that we dont block in case the cluster filesystem is unavailable
        (
-               stat $RECLOCKFILE
-               [ "$?" -eq 0 ] && {
+               stat $RECLOCKFILE && {
                        # we could stat the file, reset the counter
                        ctdb_counter_init "$RECLOCKCOUNT"
                }