浏览代码

fix(vh): log a message when the password is not set or to short (#3738)

Christian 4 年之前
父节点
当前提交
079fe0766e
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      lgsm/functions/check_config.sh

+ 8 - 0
lgsm/functions/check_config.sh

@@ -25,3 +25,11 @@ elif [ -v rconpassword ]&&[ "${rconpassword}" == "CHANGE_ME" ]; then
 	fn_print_warn_nl "Default RCON Password detected"
 	fn_script_log_warn "Default RCON Password detected"
 fi
+
+if [ "${shortname}" == "vh" ]&&[ -z "${serverpassword}" ]; then
+	fn_print_fail_nl "serverpassword is not set"
+	fn_script_log_fatal "serverpassword is not set"
+elif [ "${shortname}" == "vh" ]&&[ "${#serverpassword}" -le "4" ]; then
+	fn_print_fail_nl "serverpassword is to short (min 5 chars)"
+	fn_script_log_fatal "serverpassword is to short (min 5 chars)"
+fi