From 7ddbbfd64ae768654ea4aaf9c68ab4bbd5b65a18 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 00:05:18 +0100 Subject: [PATCH] feat: improve error message for unknown game server (#4218) The code changes modify the error message displayed when an unknown game server is entered. The new message now capitalizes the first letter of "unknown" and adds an exit status of 1 to terminate the script. --- linuxgsm.sh | 3 ++- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index 30531fa754..1a5b21904e 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -369,7 +369,8 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" + exit 1 fi else fn_install_getopt diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 6ecaad71a4..fb9cfd5c02 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -369,7 +369,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 7eb3fe2b2c..999e191fb9 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 4275b1f676..75656e14ac 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index f7f1cfb8c6..e3093f3b59 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt