diff options
author | Martin Schwenke <martin@meltin.net> | 2012-04-24 17:17:59 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-04-27 15:42:42 +1000 |
commit | 6a21c819e77a7e1cfdd081b24c3521129f9388bd (patch) | |
tree | d16b15c52210bfc91481e2d2d272904653c8f0e4 | |
parent | 0c8f7856281ba5df9c6dc796fb2aeeb34b31294a (diff) | |
download | samba-6a21c819e77a7e1cfdd081b24c3521129f9388bd.tar.gz samba-6a21c819e77a7e1cfdd081b24c3521129f9388bd.tar.xz samba-6a21c819e77a7e1cfdd081b24c3521129f9388bd.zip |
tests/eventscripts: Be more defensive about removing the var directory
Could add -r but that might avoid error. The only time it doesn't
exist is the 1st time a top-level var directory is used.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 047d97dc84a5943556efb31bb2856fd04835fffa)
-rw-r--r-- | ctdb/tests/eventscripts/scripts/local.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index 25003052a0..c31e9fae26 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -55,7 +55,8 @@ EOF fi export EVENTSCRIPTS_TESTS_VAR_DIR="${TEST_VAR_DIR}/unit_eventscripts" -if [ "$EVENTSCRIPTS_TESTS_VAR_DIR" != "/unit_eventscripts" ] ; then +if [ -d "$EVENTSCRIPTS_TESTS_VAR_DIR" -a \ + "$EVENTSCRIPTS_TESTS_VAR_DIR" != "/unit_eventscripts" ] ; then rm -r "$EVENTSCRIPTS_TESTS_VAR_DIR" fi mkdir -p "$EVENTSCRIPTS_TESTS_VAR_DIR" |