From 2507a08b3cc4a5da444f1ad075d277b0496e16e8 Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 30 Mar 2015 18:18:05 +0200 Subject: [PATCH] Fixed onovy's PR for same dir check --- osync.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/osync.sh b/osync.sh index 3c7e069..0e8afbe 100755 --- a/osync.sh +++ b/osync.sh @@ -4,7 +4,7 @@ PROGRAM="Osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" PROGRAM_VERSION=0.99RC4 -PROGRAM_BUILD=3003201501 +PROGRAM_BUILD=3003201502 ## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode if ! type -p "$BASH" > /dev/null @@ -638,10 +638,13 @@ function CheckMasterSlaveDirs MASTER_SYNC_DIR_CANN=$(readlink -f "$MASTER_SYNC_DIR") SLAVE_SYNC_DIR_CANN=$(readlink -f "$SLAVE_SYNC_DIR") - if [ "$MASTER_SYNC_DIR_CANN" == "$SLAVE_SYNC_DIR_CANN" ] + if [ "$REMOTE_SYNC" != "yes" ] then - LogError "Master directory [$MASTER_SYNC_DIR] can't be same as slave directory." - exit 1 + if [ "$MASTER_SYNC_DIR_CANN" == "$SLAVE_SYNC_DIR_CANN" ] + then + LogError "Master directory [$MASTER_SYNC_DIR] can't be the same as slave directory." + exit 1 + fi fi if ! [ -d "$MASTER_SYNC_DIR" ]