Skip to content

Commit d34bc29

Browse files
authored
feat: game server config migration (#4262)
* refactor: simplify game directory names in install_config.sh The commit simplifies the game directory names in the install_config.sh file. It replaces specific game directory names with a generic variable, shortname, to improve code readability and maintainability. * fix: handle invalid directory paths The code now checks if the server files or system directory exist before proceeding. If either directory does not exist, an error message is printed and the script exits.
1 parent ce9f864 commit d34bc29

File tree

2 files changed

+12
-121
lines changed

2 files changed

+12
-121
lines changed

lgsm/modules/check_system_dir.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77

88
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
99

10-
if [ "${commandname}" != "VALIDATE" ]; then
11-
checkdir="${serverfiles}"
12-
else
13-
checkdir="${systemdir}"
10+
if [ ! -d "${serverfiles}" ]; then
11+
fn_print_fail_nl "Cannot access ${serverfiles}: No such directory"
12+
if [ -d "${lgsmlogdir}" ]; then
13+
fn_script_log_fatal "Cannot access ${serverfiles}: No such directory."
14+
fi
15+
core_exit.sh
1416
fi
1517

16-
if [ ! -d "${checkdir}" ]; then
17-
fn_print_fail_nl "Cannot access ${checkdir}: No such directory"
18+
if [ ! -d "${systemdir}" ]; then
19+
fn_print_fail_nl "Cannot access ${systemdir}: No such directory"
1820
if [ -d "${lgsmlogdir}" ]; then
19-
fn_script_log_fatal "Cannot access ${checkdir}: No such directory."
21+
fn_script_log_fatal "Cannot access ${systemdir}: No such directory."
2022
fi
2123
core_exit.sh
2224
fi

0 commit comments

Comments
 (0)