]> granicus.if.org Git - ejabberd/commitdiff
Allow run joincluster as non root when ejabberd installed as root (#497)
authorChristophe Romain <christophe.romain@process-one.net>
Wed, 13 May 2015 13:54:28 +0000 (15:54 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Wed, 13 May 2015 13:54:28 +0000 (15:54 +0200)
tools/joincluster

index e62084bc4d87ea43e03d22e853c6fa3a5719b704..b3516d94df86f70a44f983ab87355e6ff800b98f 100755 (executable)
@@ -95,8 +95,7 @@ REMOTENAME=-name
 set -o errexit
 set -o nounset
 
-[ -d $SPOOL_DIR ] && rm -Rf $SPOOL_DIR
-mkdir $SPOOL_DIR || error "$SPOOL_DIR cannot be created" 20
+[ -d $SPOOL_DIR ] && rm -Rf $SPOOL_DIR/* || mkdir -p $SPOOL_DIR || error "$SPOOL_DIR cannot be created" 20
 [ -w $SPOOL_DIR ] || error "$SPOOL_DIR directory is not writable" 21
 mkdir -p $PA || error "$PA cannot be created" 22
 cd $PA