Преглед изворни кода

Merge pull request #945 from dgibbs64/rustrconwarn

RCON password check for Rust
Daniel Gibbs пре 9 година
родитељ
комит
9b36cb7130
1 измењених фајлова са 20 додато и 1 уклоњено
  1. 20 1
      lgsm/functions/check_config.sh

+ 20 - 1
lgsm/functions/check_config.sh

@@ -17,4 +17,23 @@ 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_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