Przeglądaj źródła

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.
UltimateByte 10 lat temu
rodzic
commit
002c7a99e4
1 zmienionych plików z 18 dodań i 1 usunięć
  1. 18 1
      lgsm/functions/check_config.sh

+ 18 - 1
lgsm/functions/check_config.sh

@@ -17,4 +17,21 @@ if [ ! -e "${servercfgfullpath}" ]; then
 		fn_script_log_warn "${servercfgfullpath}"
 		sleep 2
 	fi
-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
+fi