From 8018871168ad9bf76ee31f84ae01eac284519cc0 Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 20 May 2019 11:37:37 +0200 Subject: [PATCH] Minor code improvements --- dev/n_osync.sh | 10 +++++----- dev/ofunctions.sh | 2 +- upgrade-v1.0x-v1.3x.sh | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dev/n_osync.sh b/dev/n_osync.sh index 6612165..aa98cdb 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=2019052003 +PROGRAM_BUILD=2019052004 IS_STABLE=false CONFIG_FILE_REVISION_REQUIRED=1.3.0 @@ -1702,14 +1702,14 @@ function Sync { if [ "$resumeInitiator" != "synced" ]; then 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 resumeInitiator="none" fi if [ "$resumeTarget" != "synced" ]; then 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 resumeTarget="none" fi @@ -2973,12 +2973,12 @@ function GetCommandlineArguments { Usage ;; --initiator=*) - _QUICK_SYNC=$(($_QUICK_SYNC + 1)) + _QUICK_SYNC=$((_QUICK_SYNC + 1)) INITIATOR_SYNC_DIR="${i##*=}" opts=$opts" --initiator=\"$INITIATOR_SYNC_DIR\"" ;; --target=*) - _QUICK_SYNC=$(($_QUICK_SYNC + 1)) + _QUICK_SYNC=$((_QUICK_SYNC + 1)) TARGET_SYNC_DIR="${i##*=}" opts=$opts" --target=\"$TARGET_SYNC_DIR\"" ;; diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 1ce5a69..385f953 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1524,7 +1524,7 @@ function GetLocalOS { localOsName=$(GetConfFileValue "/etc/os-release" "NAME" true) localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true) 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" fi diff --git a/upgrade-v1.0x-v1.3x.sh b/upgrade-v1.0x-v1.3x.sh index 89d0b9d..403bd59 100755 --- a/upgrade-v1.0x-v1.3x.sh +++ b/upgrade-v1.0x-v1.3x.sh @@ -565,11 +565,11 @@ do case $i in --master=*) MASTER_SYNC_DIR=${i##*=} - _QUICK_SYNC=$(($_QUICK_SYNC + 1)) + _QUICK_SYNC=$((_QUICK_SYNC + 1)) ;; --slave=*) SLAVE_SYNC_DIR=${i##*=} - _QUICK_SYNC=$(($_QUICK_SYNC + 1)) + _QUICK_SYNC=$((_QUICK_SYNC + 1)) ;; --rsakey=*) SSH_RSA_PRIVATE_KEY=${i##*=}