Skip to content

Commit

Permalink
merge 2 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Sep 29, 2024
1 parent 2564d82 commit e9c6f24
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lgsm/modules/install_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ fn_check_cfgdir() {
}

# Copys default configs from Game-Server-Configs repo to server config location.
# Downloads default configs from Game-Server-Configs repo to lgsm/config-default.
fn_fetch_default_config() {
fn_default_config_remote() {
echo -e ""
echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}"
fn_messages_separator
Expand All @@ -30,14 +29,9 @@ fn_fetch_default_config() {
mkdir -p "${lgsmdir}/config-default/config-game"
githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main"
for config in "${array_configs[@]}"; do
# Downloads default configs from Game-Server-Configs repo to lgsm/config-default.
fn_fetch_file "${githuburl}/${shortname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash"
done
}

# Copys default configs from Game-Server-Configs repo to server config location.
fn_default_config_remote() {
for config in "${array_configs[@]}"; do
# every config is copied
# Every config is copied.
echo -e "copying ${config} config file."
fn_script_log_info "Copying ${servercfg} config file."
if [ "${config}" == "${servercfgdefault}" ]; then
Expand All @@ -52,7 +46,8 @@ fn_default_config_remote() {
echo -en "copying config file [ ${italic}${servercfgdir}/${config}${default} ]"
changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}")
fi
if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then # shellcheck disable=SC2181
fn_print_fail_eol_nl
fn_script_log_fail "copying config file ${servercfgfullpath}"
elif [ "${changes}" != "" ]; then
Expand Down

0 comments on commit e9c6f24

Please sign in to comment.