From 0cccd989530648b19fed488ca8086c1849331627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Sat, 25 Feb 2023 20:55:55 +0100 Subject: [PATCH] Add check if the helper scripts exist --- msman.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/msman.sh b/msman.sh index 5f9a273..ae5cff4 100755 --- a/msman.sh +++ b/msman.sh @@ -231,7 +231,6 @@ function helper_scripts_update { rm ms-manager-helper.tar.gz exit 5 fi - } # Download the update for the script @@ -263,12 +262,19 @@ function self_update { # Check helper scripts update function check_helper_scripts { - if [[ $CURRENT_SCRIPT_VERSION != $EXTRA_SCRIPTS_VERSION ]]; then - echo "Helper script verion mismatch!" - echo "Main script version: $CURRENT_SCRIPT_VERSION" - echo "Helper script version: $EXTRA_SCRIPTS_VERSION" - echo - echo "The script will now download the same version of the helper scripts as the main script." + if [[ -d .ms-manager ]]; then + source "./ms-manager/version.sh" + if [[ $CURRENT_SCRIPT_VERSION != $EXTRA_SCRIPTS_VERSION ]]; then + echo "Helper script verion mismatch!" + echo "Main script version: $CURRENT_SCRIPT_VERSION" + echo "Helper script version: $EXTRA_SCRIPTS_VERSION" + echo + echo "The script will now download the same version of the helper scripts as the main script." + helper_scripts_update + fi + else + echo "Helper scripts not found." + echo "The script will now download the helper scripts." helper_scripts_update fi } @@ -382,7 +388,8 @@ function delete_old_server { # Load the rest of the script function load_script { - # TODO: Check if the script files exist + # DONE: Check if the script files exist + # - Checked in check_helper_scripts source "./.ms-manager/detect_server.sh" source "./.ms-manager/java.sh"