Fix potential quick_sync parameter issues
This commit is contained in:
parent
4b90ac3a27
commit
826ebe1c2c
|
@ -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=2019052002
|
PROGRAM_BUILD=2019052003
|
||||||
IS_STABLE=false
|
IS_STABLE=false
|
||||||
|
|
||||||
CONFIG_FILE_REVISION_REQUIRED=1.3.0
|
CONFIG_FILE_REVISION_REQUIRED=1.3.0
|
||||||
|
@ -2939,8 +2939,8 @@ function GetCommandlineArguments {
|
||||||
Usage
|
Usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in "$@"; do
|
for i in "${@}"; do
|
||||||
case $i in
|
case "$i" in
|
||||||
--dry)
|
--dry)
|
||||||
_DRYRUN=true
|
_DRYRUN=true
|
||||||
opts=$opts" --dry"
|
opts=$opts" --dry"
|
||||||
|
@ -2974,33 +2974,33 @@ function GetCommandlineArguments {
|
||||||
;;
|
;;
|
||||||
--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\""
|
||||||
;;
|
;;
|
||||||
--rsakey=*)
|
--rsakey=*)
|
||||||
SSH_RSA_PRIVATE_KEY=${i##*=}
|
SSH_RSA_PRIVATE_KEY="${i##*=}"
|
||||||
opts=$opts" --rsakey=\"$SSH_RSA_PRIVATE_KEY\""
|
opts=$opts" --rsakey=\"$SSH_RSA_PRIVATE_KEY\""
|
||||||
;;
|
;;
|
||||||
--password-file=*)
|
--password-file=*)
|
||||||
SSH_PASSWORD_FILE=${i##*=}
|
SSH_PASSWORD_FILE="${i##*=}"
|
||||||
opts=$opts" --password-file=\"$SSH_PASSWORD_FILE\""
|
opts=$opts" --password-file=\"$SSH_PASSWORD_FILE\""
|
||||||
;;
|
;;
|
||||||
--instance-id=*)
|
--instance-id=*)
|
||||||
INSTANCE_ID=${i##*=}
|
INSTANCE_ID="${i##*=}"
|
||||||
opts=$opts" --instance-id=\"$INSTANCE_ID\""
|
opts=$opts" --instance-id=\"$INSTANCE_ID\""
|
||||||
;;
|
;;
|
||||||
--skip-deletion=*)
|
--skip-deletion=*)
|
||||||
opts=$opts" --skip-deletion=\"${i##*=}\""
|
opts=$opts" --skip-deletion=\"${i##*=}\""
|
||||||
SKIP_DELETION=${i##*=}
|
SKIP_DELETION="${i##*=}"
|
||||||
;;
|
;;
|
||||||
--sync-type=*)
|
--sync-type=*)
|
||||||
opts=$opts" --sync-type=\"${i##*=}\""
|
opts=$opts" --sync-type=\"${i##*=}\""
|
||||||
SYNC_TYPE=${i##*=}
|
SYNC_TYPE="${i##*=}"
|
||||||
;;
|
;;
|
||||||
--on-changes)
|
--on-changes)
|
||||||
_SYNC_ON_CHANGES="initiator"
|
_SYNC_ON_CHANGES="initiator"
|
||||||
|
@ -3045,10 +3045,10 @@ function GetCommandlineArguments {
|
||||||
_LOGGER_PREFIX=""
|
_LOGGER_PREFIX=""
|
||||||
;;
|
;;
|
||||||
--destination-mails=*)
|
--destination-mails=*)
|
||||||
DESTINATION_MAILS=${i##*=}
|
DESTINATION_MAILS="${i##*=}"
|
||||||
;;
|
;;
|
||||||
--remote-token=*)
|
--remote-token=*)
|
||||||
_REMOTE_TOKEN=${i##*=}
|
_REMOTE_TOKEN="${i##*=}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ $isFirstArgument == false ]; then
|
if [ $isFirstArgument == false ]; then
|
||||||
|
@ -3064,7 +3064,7 @@ function GetCommandlineArguments {
|
||||||
opts="${opts# *}"
|
opts="${opts# *}"
|
||||||
}
|
}
|
||||||
|
|
||||||
GetCommandlineArguments "$@"
|
GetCommandlineArguments "${@}"
|
||||||
|
|
||||||
## Here we set default options for quicksync tasks when no configuration file is provided.
|
## Here we set default options for quicksync tasks when no configuration file is provided.
|
||||||
if [ $_QUICK_SYNC -eq 2 ]; then
|
if [ $_QUICK_SYNC -eq 2 ]; then
|
||||||
|
|
Loading…
Reference in New Issue