Ver Fonte

fix(jk2): load the server config from GameData/base (#5166)

jk2mvded only execs config files from GameData/base, so jk2server.cfg in
GameData was never loaded and the server ran with defaults ("noname").
servercfgdir now points at GameData/base, and an existing jk2server.cfg in
the old location is moved there.

Fixes #5165
Daniel Gibbs há 1 dia atrás
pai
commit
ebba313f4a

+ 1 - 1
lgsm/config-default/config-lgsm/jk2server/_default.cfg

@@ -193,7 +193,7 @@ executabledir="${systemdir}"
 executable="./jk2mvded"
 servercfg="${selfname}.cfg"
 servercfgdefault="server.cfg"
-servercfgdir="${systemdir}"
+servercfgdir="${systemdir}/base"
 servercfgfullpath="${servercfgdir}/${servercfg}"
 
 ## Backup Directory

+ 6 - 0
lgsm/modules/check_config.sh

@@ -11,6 +11,12 @@ if [ "${shortname}" == "orar" ] && [ ! -d "${servercfgdir}" ]; then
 	install_config.sh
 fi
 
+if [ "${shortname}" == "jk2" ] && [ ! -f "${servercfgfullpath}" ] && [ -f "${systemdir}/${servercfg}" ]; then
+	fn_print_info_nl "Moving ${servercfg} to ${servercfgdir}"
+	fn_script_log_info "Moving ${systemdir}/${servercfg} to ${servercfgfullpath}"
+	mv "${systemdir}/${servercfg}" "${servercfgfullpath}"
+fi
+
 if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then
 	fn_print_warn_nl "Configuration file missing!"
 	echo -e "${servercfgfullpath}"