From e12d30d9c507d13b2510228c7a1e4a0a4a85d49f Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 20 May 2019 17:15:27 +0200 Subject: [PATCH] Minor code tweaks --- dev/n_osync.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dev/n_osync.sh b/dev/n_osync.sh index daa2918..90e4066 100644 --- a/dev/n_osync.sh +++ b/dev/n_osync.sh @@ -7,7 +7,7 @@ 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=2019052007 +PROGRAM_BUILD=2019052009 IS_STABLE=false CONFIG_FILE_REVISION_REQUIRED=1.3.0 @@ -985,7 +985,7 @@ ENDSSH return $retval else # Ugly fix for csh in FreeBSD 11 that adds leading and trailing '\"' - sed -i.tmp -e 's/^\\"//' -e 's/\\"$//' "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$replicaType.$SCRIPT_PID.$TSTAMP" + sed -i'.tmp' -e 's/^\\"//' -e 's/\\"$//' "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$replicaType.$SCRIPT_PID.$TSTAMP" retval=$? if [ $retval -ne 0 ]; then Logger "Cannot fix FreeBSD 11 remote csh syntax." "ERROR" @@ -1036,13 +1036,13 @@ function conflictList { if [ -f "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}$timestampCurrentFilename" ] && [ -f "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${TARGET[$__type]}$timestampCurrentFilename" ]; then # Remove prepending replicaPaths - sed -i'.replicaPath' "s;^${INITIATOR[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}$timestampCurrentFilename" + sed -i'.withReplicaPath' "s;^${INITIATOR[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}$timestampCurrentFilename" retval=$? if [ $retval -ne 0 ]; then Logger "Cannot remove prepending replicaPaths for current initiator timestamp file." "ERROR" return $retval fi - sed -i'.replicaPath' "s;^${TARGET[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${TARGET[$__type]}$timestampCurrentFilename" + sed -i'.withReplicaPath' "s;^${TARGET[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${TARGET[$__type]}$timestampCurrentFilename" retval=$? if [ $retval -ne 0 ]; then Logger "Cannot remove prepending replicaPaths for current target timestamp file." "ERROR" @@ -1052,13 +1052,13 @@ function conflictList { if [ -f "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}$timestampAfterFilename" ] && [ -f "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${TARGET[$__type]}$timestampAfterFilename" ]; then # Remove prepending replicaPaths - sed -i'.replicaPath' "s;^${INITIATOR[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}$timestampAfterFilename" + sed -i'.withReplicaPath' "s;^${INITIATOR[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}$timestampAfterFilename" retval=$? if [ $retval -ne 0 ]; then Logger "Cannot remove prepending replicaPaths for after initiator timestamp file." "ERROR" return $retval fi - sed -i'.replicaPath' "s;^${TARGET[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${TARGET[$__type]}$timestampAfterFilename" + sed -i'.withReplicaPath' "s;^${TARGET[$__replicaDir]};;g" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${TARGET[$__type]}$timestampAfterFilename" retval=$? if [ $retval -ne 0 ]; then Logger "Cannot remove prepending replicaPaths for after target timestamp file." "ERROR" @@ -1638,7 +1638,6 @@ function Initialize { fi done exit 1 - resumeTarget="${SYNC_ACTION[8]}" fi timestampList "${INITIATOR[$__replicaDir]}" "${INITIATOR[$__type]}" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}${INITIATOR[$__treeAfterFile]}" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/${INITIATOR[$__type]}${INITIATOR[$__timestampAfterFile]}" & @@ -1661,7 +1660,6 @@ function Initialize { fi done exit 1 - resumeTarget="${SYNC_ACTION[8]}" fi }