Skip to content

Commit

Permalink
refactor: improve installation and configuration process
Browse files Browse the repository at this point in the history
- Refactored the fix_dst.sh script to keep the shard name in server.ini consistent with the LinuxGSM config.
- Updated install_config.sh to provide clearer messages during the default config download and copy processes.
  • Loading branch information
dgibbs64 committed Sep 30, 2023
1 parent 6b2488d commit 278f47f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lgsm/modules/fix_dst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,15 @@ if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnut
ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4"
fn_fix_msg_end
fi

# Keeps shard name in server.ini the same as in the LinuxGSM config.
if [ -f "${serverfiles}/server.ini" ]; then
if [ "$(grep -Ec '^name[[:space:]]*=' "${serverfiles}/server.ini")" -eq 1 ]; then
if [ "$(grep -E '^name[[:space:]]*=' "${serverfiles}/server.ini" | cut -d '=' -f2 | tr -d '"' | tr -d ' ')" != "${shard}" ]; then
fixname="update server.ini shard name"
fn_fix_msg_start
sed -i -e "s/name[[:space:]]*=.*/name = \"${shard}\"/g" "${serverfiles}/server.ini"
fn_fix_msg_end
fi
fi
fi
6 changes: 5 additions & 1 deletion lgsm/modules/install_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn_default_config_remote() {
echo -e ""
echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}"
echo -e "${bold}=================================${default}"
echo -e "Default configs are downloaded from:"
echo -e "Downloading default configs from:"
echo -e ""
echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}"
echo -e ""
Expand Down Expand Up @@ -70,6 +70,10 @@ fn_default_config_remote() {

# Copys local default config to server config location.
fn_default_config_local() {
echo -e ""
echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}"
echo -e "${bold}=================================${default}"
echo -e "Copying default configs."
fn_check_cfgdir
echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]"
cp -n "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}"
Expand Down

0 comments on commit 278f47f

Please sign in to comment.