From 67f9e8b77de6031abdcb92ed4ac35f5e29519e32 Mon Sep 17 00:00:00 2001 From: onovy Date: Sun, 29 Mar 2015 17:30:09 +0200 Subject: [PATCH] Check if master and slave dirs is not same. --- osync.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osync.sh b/osync.sh index d5a8e73..3d0fda6 100755 --- a/osync.sh +++ b/osync.sh @@ -635,6 +635,15 @@ function CreateOsyncDirs 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" ] + then + LogError "Master directory [$MASTER_SYNC_DIR] can't be same as slave directory." + exit 1 + fi + if ! [ -d "$MASTER_SYNC_DIR" ] then if [ "$CREATE_DIRS" == "yes" ]