소스 검색

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 년 전
부모
커밋
002c7a99e4
1개의 변경된 파일18개의 추가작업 그리고 1개의 파일을 삭제
  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