Browse Source

refactor: improve error handling and display in core_exit.sh and install_config.sh

- In core_exit.sh, added a check to set exit code to 4 if it is not already set.
- In install_config.sh, improved the display of missing config file by highlighting the file path.

These changes aim to enhance the error handling and provide clearer information to users.
pull/4304/head
Daniel Gibbs 2 years ago
parent
commit
6a4baba285
  1. 2
      lgsm/modules/core_exit.sh
  2. 2
      lgsm/modules/install_config.sh

2
lgsm/modules/core_exit.sh

@ -35,7 +35,9 @@ elif [ "${exitcode}" != "0" ]; then
elif [ "${exitcode}" == "3" ]; then elif [ "${exitcode}" == "3" ]; then
fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}"
else else
# if exit code is not set assume error.
fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}"
exitcode=4
fi fi
fn_exit_dev_debug fn_exit_dev_debug
# remove trap. # remove trap.

2
lgsm/modules/install_config.sh

@ -154,7 +154,7 @@ fn_list_config_locations() {
elif [ -d "${servercfgfullpath}" ]; then elif [ -d "${servercfgfullpath}" ]; then
echo -e "Game Server Config Dir: ${servercfgfullpath}" echo -e "Game Server Config Dir: ${servercfgfullpath}"
else else
echo -e "Config file: ${red}${servercfgfullpath} (${red}FILE MISSING${default})" echo -e "Config file: ${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
fi fi
fi fi
echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}" echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}"

Loading…
Cancel
Save