From 002c7a99e4d0dc3e46366f94c7b0c39e39681bfe Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 19:02:10 +0200 Subject: [PATCH 1/2] RCON password check for Rust If no RCON password is set, it completely messes up with Rust. If the default password is set, the admin should be warned as it's quite dangerous. Tested working as expected. --- lgsm/functions/check_config.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index b42c47d9d..88a298f50 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -17,4 +17,21 @@ if [ ! -e "${servercfgfullpath}" ]; then fn_script_log_warn "${servercfgfullpath}" sleep 2 fi -fi \ No newline at end of file +fi +if [ "${gamename}" == "Rust" ]; then + if [ -z "${rconpassword}" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_warn_nl "RCON password not set!" + echo "This would lead to unexpected behavior. Aborting." + fn_script_log_warn "No RCON Password set, exitting!" + exit 1 + elif [ "${rconpassword}" == "CHANGE_ME" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_warn_nl "Default RCON Password detected!" + echo "Having CHANGE_ME as a passowrd is not very safe." + fn_script_log_warn "RCON Password is the default one!" + sleep 2 + fi +fi From f0229868328b05ba8bf65cb7ac32a4a4cad8519d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 27 Jul 2016 22:02:18 +0100 Subject: [PATCH 2/2] Now using core_exit.sh Updated to use new exit code system. I have added a wiki page with the basics https://github.com/dgibbs64/linuxgsm/wiki/LGSM-Exit-Codes Corrected typos --- lgsm/functions/check_config.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 88a298f50..61d0a8caf 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -18,20 +18,22 @@ if [ ! -e "${servercfgfullpath}" ]; then sleep 2 fi fi + if [ "${gamename}" == "Rust" ]; then - if [ -z "${rconpassword}" ]; then - fn_print_dots "" - sleep 0.5 - fn_print_warn_nl "RCON password not set!" - echo "This would lead to unexpected behavior. Aborting." - fn_script_log_warn "No RCON Password set, exitting!" - exit 1 - elif [ "${rconpassword}" == "CHANGE_ME" ]; then - fn_print_dots "" - sleep 0.5 - fn_print_warn_nl "Default RCON Password detected!" - echo "Having CHANGE_ME as a passowrd is not very safe." - fn_script_log_warn "RCON Password is the default one!" - sleep 2 - fi + if [ -z "${rconpassword}" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_fail_nl "RCON password is not set!" + echo " * Not setting an RCON password causes issues with ${gamename}" + fn_script_log_fatal "RCON password is not set" + fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}" + core_exit.sh + elif [ "${rconpassword}" == "CHANGE_ME" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_warn_nl "Default RCON Password detected!" + echo " * Having ${rconpassword} as a password is not very safe." + fn_script_log_warn "Default RCON Password detected" + sleep 2 + fi fi