1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-15 04:03:41 +01:00

Allow commandline override of config file values

This commit is contained in:
deajan 2019-05-20 23:33:06 +02:00
parent 9a5a8048bf
commit f9af20fe3b

View File

@ -7,7 +7,7 @@ PROGRAM="obackup"
AUTHOR="(C) 2013-2019 by Orsiris de Jong" AUTHOR="(C) 2013-2019 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr" CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
PROGRAM_VERSION=2.1-RC1 PROGRAM_VERSION=2.1-RC1
PROGRAM_BUILD=2018110602 PROGRAM_BUILD=2019052001
IS_STABLE=true IS_STABLE=true
#### Execution order #__WITH_PARANOIA_DEBUG #### Execution order #__WITH_PARANOIA_DEBUG
@ -1953,7 +1953,7 @@ function GetCommandlineArguments {
fi fi
for i in "$@"; do for i in "$@"; do
case $i in case "$i" in
--dry) --dry)
_DRYRUN=true _DRYRUN=true
;; ;;
@ -2025,6 +2025,7 @@ function GetCommandlineArguments {
} }
GetCommandlineArguments "$@" GetCommandlineArguments "$@"
if [ "$_DECRYPT_MODE" == true ]; then if [ "$_DECRYPT_MODE" == true ]; then
CheckCryptEnvironnment CheckCryptEnvironnment
GetLocalOS GetLocalOS
@ -2044,6 +2045,10 @@ if [ "$_ENCRYPT_MODE" == true ]; then
fi fi
LoadConfigFile "$1" LoadConfigFile "$1"
# Reload GetCommandlineArguments to override config file with runtime arguments
GetCommandlineArguments "$@"
if [ "$LOGFILE" == "" ]; then if [ "$LOGFILE" == "" ]; then
if [ -w /var/log ]; then if [ -w /var/log ]; then
LOG_FILE="/var/log/$PROGRAM.$INSTANCE_ID.log" LOG_FILE="/var/log/$PROGRAM.$INSTANCE_ID.log"