upgrade_client: Add missing variable substitution

This commit is contained in:
deajan 2025-01-25 14:15:33 +01:00
parent 0ac74cec20
commit 7ee603374e
3 changed files with 16 additions and 12 deletions

View file

@ -1,11 +1,12 @@
:: Example upgrade script for NPBackup that will be pushed server side
:: The following variables will be overwritten by the upgrade process
:: {CURRENT_DIR} - The current directory of the distribution
:: {backup_dist} - A directory where we try to move / copy the current distribution
:: {upgrade_dist} - The directory where the new distribution is extracted to after download
:: {log_file} - The log file where the output of this script will be written
:: {original_args} - The arguments that were passed to the upgrade script
:: {CURRENT_DIR} - The current directory of the distribution
:: {backup_dist} - A directory where we try to move / copy the current distribution
:: {upgrade_dist} - The directory where the new distribution is extracted to after download
:: {downloaded_archive} - The path to the downloaded archive
:: {log_file} - The log file where the output of this script will be written
:: {original_args} - The arguments that were passed to the upgrade script
:: Also, I really HATE batch files, from the bottom of my programmer heart
:: Every try to write a one-liner batch with some variables and perhaps if statements ?

View file

@ -1,11 +1,13 @@
:: Example upgrade script for NPBackup that will be pushed server side
#/usr/bin/env bash
# Example upgrade script for NPBackup that will be pushed server side
:: The following variables will be overwritten by the upgrade process
:: {CURRENT_DIR} - The current directory of the distribution
:: {backup_dist} - A directory where we try to move / copy the current distribution
:: {upgrade_dist} - The directory where the new distribution is extracted to after download
:: {log_file} - The log file where the output of this script will be written
:: {original_args} - The arguments that were passed to the upgrade script
# The following variables will be overwritten by the upgrade process
# {CURRENT_DIR} - The current directory of the distribution
# {backup_dist} - A directory where we try to move / copy the current distribution
# {upgrade_dist} - The directory where the new distribution is extracted to after download
# {downloaded_archive} - The path to the downloaded archive
# {log_file} - The log file where the output of this script will be written
# {original_args} - The arguments that were passed to the upgrade script
echo "Launching upgrade" >> "{log_file}" 2>&1

View file

@ -333,6 +333,7 @@ def auto_upgrader(
.replace("{CURRENT_DIR}", CURRENT_DIR)
.replace("{CURRENT_EXECUTABLE}", CURRENT_EXECUTABLE)
.replace("{upgrade_dist}", upgrade_dist)
.replace("{downloaded_archive}", downloaded_archive)
.replace("{backup_dist}", backup_dist)
.replace("{log_file}", log_file)
.replace("{original_args}", original_args)