Minor fixes to 01.reclock eventscript.
authorMartin Schwenke <martin@meltin.net>
Wed, 30 Sep 2009 11:21:56 +0000 (21:21 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 1 Oct 2009 23:54:46 +0000 (09:54 +1000)
test -z really needs its argument to be quoted.  Simplified a status
test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/events.d/01.reclock

index ccc007517ca19bb690edcbc6e38434e3ed33e188..911f7dc9f847afb7569565215909f89bcb7ddec3 100755 (executable)
@@ -31,7 +31,7 @@ case $cmd in
        }
 
        RECLOCKFILE=`ctdb -Y getreclock`
-       [ -z $RECLOCKFILE ] && {
+       [ -z "$RECLOCKFILE" ] && {
                # we are not using a reclock file
                echo -n > $RECLOCKCOUNT
                exit 0
@@ -40,8 +40,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
                        echo -n > $RECLOCKCOUNT
                }