From 99619f842deedcb46fb7c6f6be1290495fdbaf42 Mon Sep 17 00:00:00 2001 From: deajan Date: Fri, 19 Aug 2016 10:20:56 +0200 Subject: [PATCH] Upgrade script updates header too and adds KEEP_LOGGING --- upgrade-v1.0x-v1.2x.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/upgrade-v1.0x-v1.2x.sh b/upgrade-v1.0x-v1.2x.sh index 7b02d1a..ab0c291 100755 --- a/upgrade-v1.0x-v1.2x.sh +++ b/upgrade-v1.0x-v1.2x.sh @@ -6,7 +6,7 @@ AUTHOR="(C) 2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" OLD_PROGRAM_VERSION="v1.0x-v1.1x" NEW_PROGRAM_VERSION="v1.2x" -PROGRAM_BUILD=2016080901 +PROGRAM_BUILD=2016081902 # Will go into config file rev ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode if ! type "$BASH" > /dev/null; then @@ -371,6 +371,10 @@ function RewriteConfigFiles { sed -i'.tmp' '/^PRESERVE_HARDLINKS=*/a\'$'\n''CHECKSUM=no\'$'\n''' "$config_file" fi + if ! grep "^KEEP_LOGGING=" "$config_file" > /dev/null; then + sed -i'.tmp' '/^HARD_MAX_EXEC_TIME=*/a\'$'\n''KEEP_LOGGING=1801\'$'\n''' "$config_file" + fi + if ! grep "^MAX_WAIT=" "$config_file" > /dev/null; then sed -i'.tmp' '/^MIN_WAIT=*/a\'$'\n''MAX_WAIT=300\'$'\n''' "$config_file" fi @@ -387,6 +391,9 @@ function RewriteConfigFiles { sed -i'.tmp' '/^STOP_ON_CMD_ERROR=*/a\'$'\n''RUN_AFTER_CMD_ON_ERROR=no\'$'\n''' "$config_file" fi + # "onfig file rev" to deal with earlier variants of the file + sed -i'.tmp' '/onfig file rev/c\###### osync config file rev '$PROGRAM_BUILD "$config_file" + rm -f "$config_file.tmp" }