Skip to content

Commit

Permalink
Backup of the speedtest binary
Browse files Browse the repository at this point in the history
  • Loading branch information
leiweibau committed Feb 23, 2024
1 parent 3b4c5d0 commit cf5c9b2
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions install/pialert_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ main() {
download_pialert
update_config
update_db
move_files_again
update_permissions
start_pialert

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit cf5c9b2

Please sign in to comment.