Minor code improvements
This commit is contained in:
parent
826ebe1c2c
commit
8018871168
|
@ -7,7 +7,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
||||||
AUTHOR="(C) 2013-2019 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2019 by Orsiris de Jong"
|
||||||
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=1.3.0-pre-rc1
|
PROGRAM_VERSION=1.3.0-pre-rc1
|
||||||
PROGRAM_BUILD=2019052003
|
PROGRAM_BUILD=2019052004
|
||||||
IS_STABLE=false
|
IS_STABLE=false
|
||||||
|
|
||||||
CONFIG_FILE_REVISION_REQUIRED=1.3.0
|
CONFIG_FILE_REVISION_REQUIRED=1.3.0
|
||||||
|
@ -1702,14 +1702,14 @@ function Sync {
|
||||||
|
|
||||||
if [ "$resumeInitiator" != "synced" ]; then
|
if [ "$resumeInitiator" != "synced" ]; then
|
||||||
Logger "Trying to resume aborted execution on $($STAT_CMD "${INITIATOR[$__initiatorLastActionFile]}") at task [$resumeInitiator] for initiator. [$resumeCount] previous tries." "NOTICE"
|
Logger "Trying to resume aborted execution on $($STAT_CMD "${INITIATOR[$__initiatorLastActionFile]}") at task [$resumeInitiator] for initiator. [$resumeCount] previous tries." "NOTICE"
|
||||||
echo $(($resumeCount+1)) > "${INITIATOR[$__resumeCount]}"
|
echo $((resumeCount+1)) > "${INITIATOR[$__resumeCount]}"
|
||||||
else
|
else
|
||||||
resumeInitiator="none"
|
resumeInitiator="none"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$resumeTarget" != "synced" ]; then
|
if [ "$resumeTarget" != "synced" ]; then
|
||||||
Logger "Trying to resume aborted execution on $($STAT_CMD "${INITIATOR[$__targetLastActionFile]}") as task [$resumeTarget] for target. [$resumeCount] previous tries." "NOTICE"
|
Logger "Trying to resume aborted execution on $($STAT_CMD "${INITIATOR[$__targetLastActionFile]}") as task [$resumeTarget] for target. [$resumeCount] previous tries." "NOTICE"
|
||||||
echo $(($resumeCount+1)) > "${INITIATOR[$__resumeCount]}"
|
echo $((resumeCount+1)) > "${INITIATOR[$__resumeCount]}"
|
||||||
else
|
else
|
||||||
resumeTarget="none"
|
resumeTarget="none"
|
||||||
fi
|
fi
|
||||||
|
@ -2973,12 +2973,12 @@ function GetCommandlineArguments {
|
||||||
Usage
|
Usage
|
||||||
;;
|
;;
|
||||||
--initiator=*)
|
--initiator=*)
|
||||||
_QUICK_SYNC=$(($_QUICK_SYNC + 1))
|
_QUICK_SYNC=$((_QUICK_SYNC + 1))
|
||||||
INITIATOR_SYNC_DIR="${i##*=}"
|
INITIATOR_SYNC_DIR="${i##*=}"
|
||||||
opts=$opts" --initiator=\"$INITIATOR_SYNC_DIR\""
|
opts=$opts" --initiator=\"$INITIATOR_SYNC_DIR\""
|
||||||
;;
|
;;
|
||||||
--target=*)
|
--target=*)
|
||||||
_QUICK_SYNC=$(($_QUICK_SYNC + 1))
|
_QUICK_SYNC=$((_QUICK_SYNC + 1))
|
||||||
TARGET_SYNC_DIR="${i##*=}"
|
TARGET_SYNC_DIR="${i##*=}"
|
||||||
opts=$opts" --target=\"$TARGET_SYNC_DIR\""
|
opts=$opts" --target=\"$TARGET_SYNC_DIR\""
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -1524,7 +1524,7 @@ function GetLocalOS {
|
||||||
localOsName=$(GetConfFileValue "/etc/os-release" "NAME" true)
|
localOsName=$(GetConfFileValue "/etc/os-release" "NAME" true)
|
||||||
localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true)
|
localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true)
|
||||||
elif [ "$LOCAL_OS" == "BusyBox" ]; then
|
elif [ "$LOCAL_OS" == "BusyBox" ]; then
|
||||||
localOsVer=`ls --help 2>&1 | head -1 | cut -f2 -d' '`
|
localOsVer=$(ls --help 2>&1 | head -1 | cut -f2 -d' ')
|
||||||
localOsName="BusyBox"
|
localOsName="BusyBox"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -565,11 +565,11 @@ do
|
||||||
case $i in
|
case $i in
|
||||||
--master=*)
|
--master=*)
|
||||||
MASTER_SYNC_DIR=${i##*=}
|
MASTER_SYNC_DIR=${i##*=}
|
||||||
_QUICK_SYNC=$(($_QUICK_SYNC + 1))
|
_QUICK_SYNC=$((_QUICK_SYNC + 1))
|
||||||
;;
|
;;
|
||||||
--slave=*)
|
--slave=*)
|
||||||
SLAVE_SYNC_DIR=${i##*=}
|
SLAVE_SYNC_DIR=${i##*=}
|
||||||
_QUICK_SYNC=$(($_QUICK_SYNC + 1))
|
_QUICK_SYNC=$((_QUICK_SYNC + 1))
|
||||||
;;
|
;;
|
||||||
--rsakey=*)
|
--rsakey=*)
|
||||||
SSH_RSA_PRIVATE_KEY=${i##*=}
|
SSH_RSA_PRIVATE_KEY=${i##*=}
|
||||||
|
|
Loading…
Reference in New Issue