From aca0be5a9b9a9b28159bdb219516cc01dfec641a Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 20 May 2019 22:19:27 +0200 Subject: [PATCH] Rebuilt targets --- dev/debug_osync.sh | 25 ++++++++++--------------- osync.sh | 25 ++++++++++--------------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index 4d29f41..0c1d2d4 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -6,8 +6,8 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2019 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.3.0-pre-rc1 -PROGRAM_BUILD=2019052011 +PROGRAM_VERSION=1.3.0-beta2 +PROGRAM_BUILD=2019052013 IS_STABLE=false CONFIG_FILE_REVISION_REQUIRED=1.3.0 @@ -2519,7 +2519,6 @@ function CheckCurrentConfig { # v2 config will use true / false instead of yes / no # Check all variables that should contain "yes" or "no", true or false for i in "${booleans[@]}"; do - #test="if [ \"\$$i\" != \"yes\" ] && [ \"\$$i\" != \"no\" ] && [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi" test="if [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi" eval "$test" # Fix for upcomming v2 where yes and no do not exist anymore @@ -3344,24 +3343,20 @@ function HandleLocks { targetLockSuccess=false fi done - - #WIP refactor the following - if [ $initiatorLockSuccess == true ]; then - INITIATOR_LOCK_FILE_EXISTS=true - fi - if [ $targetLockSuccess == true ]; then - TARGET_LOCK_FILE_EXISTS=true - fi - Logger "Cancelling task." "CRITICAL" $retval - exit 1 fi + if [ $initiatorLockSuccess == true ]; then INITIATOR_LOCK_FILE_EXISTS=true fi if [ $targetLockSuccess == true ]; then TARGET_LOCK_FILE_EXISTS=true fi + + if [ $retval -ne 0 ]; then + Logger "Cancelling task." "CRITICAL" $retval + exit 1 + fi } function _UnlockReplicasLocal { @@ -4865,7 +4860,7 @@ function Sync { ## Step 2a & 2b if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[2]}" ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then - #TODO: refactor in v1.3 with syncattrs + #TODO: refactor in v1.4 with syncattrs if [ "$LOG_CONFLICTS" == true ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ]; then @@ -5121,7 +5116,7 @@ function Sync { # Step 8a & 8b if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[8]}" ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then - #TODO: refactor in v1.3 with syncattrs + #TODO: refactor in v1.4 with syncattrs if [ "$LOG_CONFLICTS" == true ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ]; then diff --git a/osync.sh b/osync.sh index cc8d78f..171dc65 100755 --- a/osync.sh +++ b/osync.sh @@ -6,8 +6,8 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2019 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.3.0-pre-rc1 -PROGRAM_BUILD=2019052011 +PROGRAM_VERSION=1.3.0-beta2 +PROGRAM_BUILD=2019052013 IS_STABLE=false CONFIG_FILE_REVISION_REQUIRED=1.3.0 @@ -2368,7 +2368,6 @@ function CheckCurrentConfig { # v2 config will use true / false instead of yes / no # Check all variables that should contain "yes" or "no", true or false for i in "${booleans[@]}"; do - #test="if [ \"\$$i\" != \"yes\" ] && [ \"\$$i\" != \"no\" ] && [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi" test="if [ \"\$$i\" != true ] && [ \"\$$i\" != false ]; then Logger \"Bogus $i value [\$$i] defined in config file. Correct your config file or update it using the update script if using and old version.\" \"CRITICAL\"; exit 1; fi" eval "$test" # Fix for upcomming v2 where yes and no do not exist anymore @@ -3168,24 +3167,20 @@ function HandleLocks { targetLockSuccess=false fi done - - #WIP refactor the following - if [ $initiatorLockSuccess == true ]; then - INITIATOR_LOCK_FILE_EXISTS=true - fi - if [ $targetLockSuccess == true ]; then - TARGET_LOCK_FILE_EXISTS=true - fi - Logger "Cancelling task." "CRITICAL" $retval - exit 1 fi + if [ $initiatorLockSuccess == true ]; then INITIATOR_LOCK_FILE_EXISTS=true fi if [ $targetLockSuccess == true ]; then TARGET_LOCK_FILE_EXISTS=true fi + + if [ $retval -ne 0 ]; then + Logger "Cancelling task." "CRITICAL" $retval + exit 1 + fi } function _UnlockReplicasLocal { @@ -4655,7 +4650,7 @@ function Sync { ## Step 2a & 2b if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[2]}" ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then - #TODO: refactor in v1.3 with syncattrs + #TODO: refactor in v1.4 with syncattrs if [ "$LOG_CONFLICTS" == true ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[2]}" ]; then @@ -4911,7 +4906,7 @@ function Sync { # Step 8a & 8b if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ] || [ "$resumeTarget" == "${SYNC_ACTION[8]}" ]; then #if [[ "$RSYNC_ATTR_ARGS" == *"-X"* ]] || [[ "$RSYNC_ATTR_ARGS" == *"-A"* ]] || [ "$LOG_CONFLICTS" == true ]; then - #TODO: refactor in v1.3 with syncattrs + #TODO: refactor in v1.4 with syncattrs if [ "$LOG_CONFLICTS" == true ]; then if [ "$resumeInitiator" == "${SYNC_ACTION[8]}" ]; then