From cf5c9b2528e4c5595ae2370e32cb755914818615 Mon Sep 17 00:00:00 2001 From: leiweibau <105860611+leiweibau@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:40:22 +0100 Subject: [PATCH] Backup of the speedtest binary --- install/pialert_update.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/install/pialert_update.sh b/install/pialert_update.sh index 7783cbe97..a2be68e52 100644 --- a/install/pialert_update.sh +++ b/install/pialert_update.sh @@ -47,6 +47,7 @@ main() { download_pialert update_config update_db + move_files_again update_permissions start_pialert @@ -119,13 +120,22 @@ create_backup() { } # ------------------------------------------------------------------------------ -# Move files to the new directory +# Move files to the temp directory # ------------------------------------------------------------------------------ move_files() { - if [ -e "$PIALERT_HOME/back/pialert.conf" ] ; then - print_msg "- Moving pialert.conf to the new directory..." - mkdir -p "$PIALERT_HOME/config" - mv "$PIALERT_HOME/back/pialert.conf" "$PIALERT_HOME/config" + if [ -e "$PIALERT_HOME/back/speedtest/speedtest" ] ; then + echo "- Moving speedtest to temporary directory..." + mv "$PIALERT_HOME/back/speedtest" "$PIALERT_HOME/config" + fi +} + +# ------------------------------------------------------------------------------ +# Move files from the temp directory +# ------------------------------------------------------------------------------ +move_files_again() { + if [ -e "$PIALERT_HOME/config/speedtest/speedtest" ] ; then + echo "- Moving speedtest from temporary directory..." + mv "$PIALERT_HOME/config/speedtest" "$PIALERT_HOME/back" fi }