From d1fc35c8ea1ae2525b09634e2a9beb3e202760ac Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Thu, 20 Oct 2022 12:57:27 +0200 Subject: [PATCH] suggested changes --- helperFunctions.sh | 4 +--- runs/restore.sh | 3 +-- web/settings/backup.php | 6 ++---- web/settings/upload.php | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/helperFunctions.sh b/helperFunctions.sh index dd26d9e377..82ec906ab4 100755 --- a/helperFunctions.sh +++ b/helperFunctions.sh @@ -102,9 +102,7 @@ openwbDebugLog() { export -f openwbDebugLog openwbRunLoggingOutput() { - functionName="$1" - shift - $functionName "$@" 2>&1 | while read -r line + "$@" 2>&1 | while read -r line do # use path to /var/log as link in ramdisk may not be set up yet! echo "$(date +"%Y-%m-%d %H:%M:%S"): $1: $line" >> "/var/log/openWB.log" diff --git a/runs/restore.sh b/runs/restore.sh index 625ac29f11..dccac44d6e 100755 --- a/runs/restore.sh +++ b/runs/restore.sh @@ -28,8 +28,7 @@ LOGFILE="$OPENWBBASEDIR/web/tools/upload/restore.log" echo "****************************************" echo "Step 4: replacing old files..." # we use cp not mv because of not empty directories in destination - # dotglob is needed to include files and directories beginning with a dot - (shopt -s dotglob; sudo cp -v -p -r "${WORKINGDIR}${OPENWBBASEDIR}/"* "${OPENWBBASEDIR}/") + sudo cp -v -p -r "${WORKINGDIR}${OPENWBBASEDIR}/." "${OPENWBBASEDIR}/" echo "****************************************" echo "Step 5: restoring mosquitto db..." if [[ -f "${WORKINGDIR}${MOSQUITTODIR}/mosquitto.db" ]]; then diff --git a/web/settings/backup.php b/web/settings/backup.php index d1d0236c36..575eb5f067 100644 --- a/web/settings/backup.php +++ b/web/settings/backup.php @@ -1,10 +1,8 @@ diff --git a/web/settings/upload.php b/web/settings/upload.php index 3623b5623d..a3dae56c6e 100644 --- a/web/settings/upload.php +++ b/web/settings/upload.php @@ -139,7 +139,7 @@ function(data){