diff --git a/.gitattributes b/.gitattributes index 802343b27a..bbe6490d1f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,4 +19,4 @@ *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain -*.RTF diff=astextplain \ No newline at end of file +*.RTF diff=astextplain diff --git a/.github/ISSUE_TEMPLATE/new-server-request.md b/.github/ISSUE_TEMPLATE/new-server-request.md index d27b3b4972..adb1f5f4f6 100644 --- a/.github/ISSUE_TEMPLATE/new-server-request.md +++ b/.github/ISSUE_TEMPLATE/new-server-request.md @@ -26,4 +26,4 @@ If yes Use SteamDB to get the appid. (https://steamdb.info). We only support Linux servers and do not support Wine. * [ ] Yes -* [ ] No \ No newline at end of file +* [ ] No diff --git a/.github/potential-duplicates.yml b/.github/potential-duplicates.yml index 9c973de065..3ca5a7cb8e 100644 --- a/.github/potential-duplicates.yml +++ b/.github/potential-duplicates.yml @@ -10,4 +10,4 @@ referenceComment: > Potential duplicates: {{#issues}} - [#{{ number }}] {{ title }} ({{ accuracy }}%) - {{/issues}} \ No newline at end of file + {{/issues}} diff --git a/.github/request-info.yml b/.github/request-info.yml index 1b354d9f70..ed407c3b57 100644 --- a/.github/request-info.yml +++ b/.github/request-info.yml @@ -3,7 +3,7 @@ # *Required* Comment to reply with requestInfoReplyComment: > ![More Data required](https://i.imgur.com/yS9cecv.png) - More data is required to assist with this issue + More data is required to assist with this issue or issue template was not used correctly. https://linuxgsm.com/support/#guide @@ -14,4 +14,4 @@ requestInfoReplyComment: > # - updates # *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given -requestInfoLabelToAdd: "needs more info" \ No newline at end of file +requestInfoLabelToAdd: "needs more info" diff --git a/.github/topissuebot.yml b/.github/topissuebot.yml index b02540a2da..06c64ae014 100644 --- a/.github/topissuebot.yml +++ b/.github/topissuebot.yml @@ -1,4 +1,4 @@ # Configuration for top-issue-bot labelName: ":thumbsup: Top Issue!" labelColor: "f442c2" -numberOfIssuesToLabel: 5 \ No newline at end of file +numberOfIssuesToLabel: 5 diff --git a/.github/welcome.yml b/.github/welcome.yml index 7a120a2fa9..7d0cb281b9 100644 --- a/.github/welcome.yml +++ b/.github/welcome.yml @@ -18,4 +18,4 @@ newPRWelcomeComment: > firstPRMergeComment: > Congratulations on merging your first pull request! Thank you for supporting LinuxGSM! -# It is recommend to include as many gifs and emojis as possible \ No newline at end of file +# It is recommend to include as many gifs and emojis as possible diff --git a/.github/write-good.yml b/.github/write-good.yml index 2bdb512ada..00eefa99ce 100644 --- a/.github/write-good.yml +++ b/.github/write-good.yml @@ -1,4 +1,4 @@ # .github/write-good.yml writeGood: true alex: true -spellchecker: true \ No newline at end of file +spellchecker: true diff --git a/.gitignore b/.gitignore index 2b0bcabc1b..12218bea33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ *.db -.idea \ No newline at end of file +.idea diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 764f21e195..33650771e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,4 +33,4 @@ This will help us in understanding your code and determining where problems may Start reading our code and you'll get the hang of it. Explore how functions are organized and you'll see how we strive for readable code. Please give the following document a read and adjust your code according to its specifications. -[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions) \ No newline at end of file +[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions) diff --git a/LICENSE b/LICENSE index 9bcd642514..950cea23a6 100644 --- a/LICENSE +++ b/LICENSE @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README.md b/README.md index a028258e8a..73d811da3c 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@
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OPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Build Status](https://travis-ci.com/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.com/GameServerManagers/LinuxGSM) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3e98be27840043a090c3ab6e35db44b0)](https://app.codacy.com/app/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade_Dashboard) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW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contributors-9-orange.svg?style=flat-square)](#contributors) - -[LinuxGSM](https://linuxgsm.com) is the command line tool for quick, simple deployment and management of dedicated game servers. + +[LinuxGSM](https://linuxgsm.com) is the command line tool for quick, simple deployment and management of dedicated game servers. ## Hassle-Free Dedicated Game Servers @@ -15,22 +15,22 @@ Traditionally game servers are not easy to manage yourself. Admins often have to 80+ game servers supported -* :truck: Installer -* :mag: Monitor -* :phone: Alerts -* :cloud: Updater -* :blue_book: Server Details -* :floppy_disk: Backup +* :truck: Installer +* :mag: Monitor +* :phone: Alerts +* :cloud: Updater +* :blue_book: Server Details +* :floppy_disk: Backup * :computer: Console -## :penguin: Compatibility +## :penguin: Compatibility Linux Game Server Managers are tested to work on the following Linux distros. * Debian based (Ubuntu, Mint etc.) * Red Hat based (CentOS, Fedora etc.) -Other distros are likely to work but are not fully tested. +Other distros are likely to work but are not fully tested. ## :wrench: Requirements @@ -41,7 +41,7 @@ Each game server has its own specific dependency requirements, but most require ## :blue_book: Documentation -Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgsm.com](https://docs.linuxgsm.com) +Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgsm.com](https://docs.linuxgsm.com) ## :question: Support @@ -61,4 +61,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index f1ceb73e55..1517261fc5 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -23,4 +23,4 @@ if [ "${exitcode}" == "0" ]; then else fn_print_fail_nl "Sending Email alert: ${email}" fn_script_log_fatal "Sending Email alert: ${email}" -fi \ No newline at end of file +fi diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 0f6a0f8635..61e1df2f98 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -120,7 +120,7 @@ fn_install_universe_repo(){ sleep 1 echo -en " \r" cmd="sudo apt-add-repository universe" - eval ${cmd} + eval "${cmd}" if [ $? -eq 0 ]; then fn_print_complete_nl "Installing universe repository completed." fn_script_log_pass "Installing universe repository completed." diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 7108b16c15..aa7bb3de27 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -9,17 +9,17 @@ local commandname="CHECK" fn_check_ownership(){ if [ -f "${rootdir}/${selfname}" ]; then - if [ "$(find "${rootdir}/${selfname}" -not -user $(whoami) | wc -l)" -ne "0" ]; then + if [ "$(find "${rootdir}/${selfname}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then selfownissue=1 fi fi if [ -d "${functionsdir}" ]; then - if [ "$(find "${functionsdir}" -not -user $(whoami) | wc -l)" -ne "0" ]; then + if [ "$(find "${functionsdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then funcownissue=1 fi fi if [ -d "${serverfiles}" ]; then - if [ "$(find "${serverfiles}" -not -user $(whoami) | wc -l)" -ne "0" ]; then + if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then filesownissue=1 fi fi diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index 0a10b15ac2..fd9ff36449 100644 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -20,4 +20,3 @@ if [ ! -d "${checkdir}" ]; then fi core_exit.sh fi - diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/functions/command_dev_clear_functions.sh index bf026ced54..5c698f05ff 100644 --- a/lgsm/functions/command_dev_clear_functions.sh +++ b/lgsm/functions/command_dev_clear_functions.sh @@ -12,4 +12,4 @@ if fn_prompt_yn "Do you want to delete all functions?" Y; then rm -rfv "${functionsdir:?}/"* rm -rfv "${configdirdefault:?}/"* fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_donate.sh index a277b87b67..0cb3a0aee5 100644 --- a/lgsm/functions/command_donate.sh +++ b/lgsm/functions/command_donate.sh @@ -15,4 +15,4 @@ echo -e "* ${blue}Patreon:${default} https://linuxgsm.com/patreon" echo -e "* ${blue}PayPal:${default} https://linuxgsm.com/paypal" echo -e "* ${blue}Flattr:${default} https://linuxgsm.com/flattr" echo -e "" -echo -e "LinuxGSM has been going since 2012" \ No newline at end of file +echo -e "LinuxGSM has been going since 2012" diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index c09250217b..5dba7ba537 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -196,7 +196,7 @@ fn_fastdl_preview(){ echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention}) tput rc; tput el - printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + echo "gathering ${directory} ${allowed_extention} : ${fileswc}..." if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl else @@ -245,7 +245,7 @@ fn_fastdl_gmod(){ while read -r fastdlfile; do ((fileswc++)) tput rc; tput el - printf "copying ${allowed_extention} : ${fileswc}..." + echo "copying ${allowed_extention} : ${fileswc}..." cp --parents "${fastdlfile}" "${fastdldir}" exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -255,7 +255,7 @@ fn_fastdl_gmod(){ else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" fi - done < <(find . -type f -iname ${allowed_extention}) + done < <(find . -type f -iname "${allowed_extention}") if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl fi diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index dca5fc964a..8382d1fb7b 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -96,8 +96,8 @@ fn_monitor_check_lockfile(){ } fn_monitor_check_update(){ - # Monitor will not check if update is running. - if [ "$(ps -ef | grep "${selfname} update" | grep -v grep | wc -l)" != "0" ]; then + # Monitor will check if update is already running. + if [ "$(pgrep "${selfname} update" | wc -l)" != "0" ]; then fn_print_error_nl "SteamCMD is currently checking for updates" fn_script_log_error "SteamCMD is currently checking for updates" core_exit.sh diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index db8678bb5f..2ece0810c5 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -11,4 +11,4 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_config.sh exitbypass=1 command_stop.sh -command_start.sh \ No newline at end of file +command_start.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index afaa82326a..ed81fe63e9 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -35,7 +35,7 @@ fn_start_teamspeak3(){ if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then install_eula.sh fi - cd "${executabledir}" + cd "${executabledir}" || exit if [ "${ts3serverpass}" == "1" ]; then ./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}" > /dev/null 2>&1 else @@ -86,7 +86,7 @@ fn_start_tmux(){ # Create lockfile date > "${rootdir}/${lockselfname}" - cd "${executabledir}" + cd "${executabledir}" || exit tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${servicename}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${servicename}-tmux-error.tmp" # Create logfile. @@ -154,7 +154,7 @@ fn_sleep_time echo "" echo "Fix" echo "=================================" - if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then + if [ ! "$(grep "tty:" /etc/group|grep "$(whoami)")" ]; then echo "$(whoami) is not part of the tty group." fn_script_log_info "$(whoami) is not part of the tty group." group=$(grep tty /etc/group) diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh index 33609b121e..4825be0273 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -10,4 +10,4 @@ functionfile="${FUNCNAME}" fn_fetch_function } -command_update_linuxgsm.sh \ No newline at end of file +command_update_linuxgsm.sh diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 910e1dec89..86eb202d8d 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -34,7 +34,7 @@ fn_clear_tmp(){ fn_print_error_eol_nl fn_script_log_error "clearing LinuxGSM tmp directory" fi - fi + fi } fn_dl_md5(){ @@ -260,4 +260,4 @@ curlpath=$(command -v curl 2>/dev/null) if [ "$(basename "${curlpath}")" != "curl" ]; then echo "[ FAIL ] Curl is not installed" exit 1 -fi \ No newline at end of file +fi diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh index 57bec2aa75..54f2ef2c5e 100644 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -10,4 +10,4 @@ fn_exit_trap(){ } # trap to give an exit code. -trap fn_exit_trap INT \ No newline at end of file +trap fn_exit_trap INT diff --git a/lgsm/functions/fix_ark.sh b/lgsm/functions/fix_ark.sh index e9be8ecafa..ccb0a93cb7 100644 --- a/lgsm/functions/fix_ark.sh +++ b/lgsm/functions/fix_ark.sh @@ -11,4 +11,4 @@ fi if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then ln -s "$HOME/Steam/steamapps/" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" -fi \ No newline at end of file +fi diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh index 06e54f7cdb..ffa3d35e09 100644 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/functions/fix_arma3.sh @@ -14,4 +14,4 @@ if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 - fn_fix_msg_start mkdir -p "${HOME}/.local/share/Arma 3 - Other Profiles" fn_fix_msg_end -fi \ No newline at end of file +fi diff --git a/lgsm/functions/fix_ges.sh b/lgsm/functions/fix_ges.sh index 977697cca8..35e1411e34 100644 --- a/lgsm/functions/fix_ges.sh +++ b/lgsm/functions/fix_ges.sh @@ -8,4 +8,4 @@ local commandname="FIX" local commandaction="Fix" # Fixes: MALLOC_CHECK_ needing to be set to 0. -export MALLOC_CHECK_=0 \ No newline at end of file +export MALLOC_CHECK_=0 diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh index e9f5f38609..bb5a8b6ca0 100644 --- a/lgsm/functions/fix_kf.sh +++ b/lgsm/functions/fix_kf.sh @@ -30,4 +30,4 @@ exitbypass=1 command_start.sh sleep 5 exitbypass=1 -command_stop.sh \ No newline at end of file +command_stop.sh diff --git a/lgsm/functions/fix_rw.sh b/lgsm/functions/fix_rw.sh index 3ce85a699b..da5fd8286c 100644 --- a/lgsm/functions/fix_rw.sh +++ b/lgsm/functions/fix_rw.sh @@ -7,4 +7,4 @@ local commandname="FIX" local commandaction="Fix" -export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH" \ No newline at end of file +export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH" diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh index 04ac7936de..ca0dc09a17 100644 --- a/lgsm/functions/fix_sdtd.sh +++ b/lgsm/functions/fix_sdtd.sh @@ -7,4 +7,4 @@ local commandname="FIX" local commandaction="Fix" -export LD_LIBRARY_PATH="${serverfiles}" \ No newline at end of file +export LD_LIBRARY_PATH="${serverfiles}" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh index 7e9b7dc97e..5632c86e43 100644 --- a/lgsm/functions/fix_ut.sh +++ b/lgsm/functions/fix_ut.sh @@ -11,4 +11,4 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #Set Binary Executable echo "chmod +x ${executabledir}/${executable}" chmod +x "${executabledir}/${executable}" -fn_sleep_time \ No newline at end of file +fn_sleep_time diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh index 3789909b3b..cc517e1f3e 100644 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/functions/fix_ut2k4.sh @@ -30,4 +30,4 @@ exitbypass=1 command_start.sh sleep 5 exitbypass=1 -command_stop.sh \ No newline at end of file +command_stop.sh diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 3b7b6b9515..76445050f7 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -235,9 +235,9 @@ fi if [ "$(command -v jq 2>/dev/null)" ]; then if [ "${ip}" ]&&[ "${port}" ]; then if [ "${steammaster}" == "true" ]; then - masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) + masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)" if [ "${masterserver}" == "0" ]; then - masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) + masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)" fi if [ "${masterserver}" == "0" ]; then displaymasterserver="false" diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 1e58ae3ac9..dfe75c037f 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1228,85 +1228,87 @@ fn_info_message_soldat() { fn_info_message_select_engine(){ # Display details depending on game or engine. - if [ "${gamename}" == "7 Days To Die" ]; then + if [ "${shortname}" == "sdtd" ]; then fn_info_message_sdtd - elif [ "${gamename}" == "ARK: Survival Evolved" ]; then + elif [ "${shortname}" == "ark" ]; then fn_info_message_ark - elif [ "${gamename}" == "Ballistic Overkill" ]; then + elif [ "${shortname}" == "bo" ]; then fn_info_message_ballisticoverkill - elif [ "${gamename}" == "Barotrauma" ]; then + elif [ "${shortname}" == "bt" ]; then fn_info_message_barotrauma - elif [ "${gamename}" == "Battalion 1944" ]; then + elif [ "${shortname}" == "bt1944" ]; then fn_info_message_battalion1944 - elif [ "${gamename}" == "Call of Duty" ]; then + elif [ "${shortname}" == "cod" ]; then fn_info_message_cod - elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then + elif [ "${shortname}" == "coduo" ]; then fn_info_message_coduo - elif [ "${gamename}" == "Call of Duty 2" ]; then + elif [ "${shortname}" == "cod2" ]; then fn_info_message_cod2 - elif [ "${gamename}" == "Call of Duty 4" ]; then + elif [ "${shortname}" == "cod4" ]; then fn_info_message_cod4 - elif [ "${gamename}" == "Call of Duty: World at War" ]; then + elif [ "${shortname}" == "codwaw" ]; then fn_info_message_codwaw - elif [ "${gamename}" == "Eco" ]; then + elif [ "${shortname}" == "eco" ]; then fn_info_message_eco - elif [ "${gamename}" == "ET: Legacy" ]; then + elif [ "${shortname}" == "etl" ]; then fn_info_message_etlegacy - elif [ "${gamename}" == "Factorio" ]; then + elif [ "${shortname}" == "fctr" ]; then fn_info_message_factorio - elif [ "${gamename}" == "Hurtworld" ]; then + elif [ "${shortname}" == "hw" ]; then fn_info_message_hurtworld elif [ "${shortname}" == "inss" ]; then fn_info_message_inss - elif [ "${gamename}" == "Just Cause 2" ]; then + elif [ "${shortname}" == "jc2" ]; then fn_info_message_justcause2 - elif [ "${gamename}" == "Just Cause 3" ]; then + elif [ "${shortname}" == "jc3" ]; then fn_info_message_justcause3 elif [ "${shortname}" == "kf2" ]; then fn_info_message_kf2 elif [ "${shortname}" == "pstbs" ]; then fn_info_message_pstbs - elif [ "${gamename}" == "Project Cars" ]; then + elif [ "${shortname}" == "pc" ]; then fn_info_message_projectcars - elif [ "${gamename}" == "QuakeWorld" ]; then + elif [ "${shortname}" == "qw" ]; then fn_info_message_quake - elif [ "${gamename}" == "Quake 2" ]; then + elif [ "${shortname}" == "q2" ]; then fn_info_message_quake2 - elif [ "${gamename}" == "Quake 3: Arena" ]; then + elif [ "${shortname}" == "q3" ]; then fn_info_message_quake3 - elif [ "${gamename}" == "Quake Live" ]; then + elif [ "${shortname}" == "ql" ]; then fn_info_message_quakelive - elif [ "${gamename}" == "San Andreas Multiplayer" ]; then + elif [ "${shortname}" == "samp" ]; then fn_info_message_samp - elif [ "${gamename}" == "Squad" ]; then + elif [ "${shortname}" == "squad" ]; then fn_info_message_squad - elif [ "${gamename}" == "Stationeers" ]; then + elif [ "${shortname}" == "st" ]; then fn_info_message_stationeers + elif [ "${shortname}" == "sof2" ]; then + fn_info_message_sof2 elif [ "${shortname}" == "sol" ]; then fn_info_message_soldat elif [ "${shortname}" == "sbots" ]; then fn_info_message_sbots - elif [ "${gamename}" == "TeamSpeak 3" ]; then + elif [ "${shortname}" == "ts3" ]; then fn_info_message_teamspeak3 - elif [ "${gamename}" == "Tower Unite" ]; then + elif [ "${shortname}" == "tu" ]; then fn_info_message_towerunite elif [ "${shortname}" == "unt" ]; then fn_info_message_unturned elif [ "${shortname}" == "mh" ]; then fn_info_message_mordhau - elif [ "${gamename}" == "Multi Theft Auto" ]; then + elif [ "${shortname}" == "mta" ]; then fn_info_message_mta - elif [ "${gamename}" == "Mumble" ]; then + elif [ "${shortname}" == "mumble" ]; then fn_info_message_mumble - elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then + elif [ "${shortname}" == "rtcw" ]; then fn_info_message_rtcw - elif [ "${gamename}" == "Rust" ]; then + elif [ "${shortname}" == "rust" ]; then fn_info_message_rust - elif [ "${gamename}" == "Wurm Unlimited" ]; then + elif [ "${shortname}" == "wurm" ]; then fn_info_message_wurmunlimited elif [ "${shortname}" == "rw" ]; then fn_info_message_risingworld - elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then + elif [ "${shortname}" == "wet" ]; then fn_info_message_wolfensteinenemyterritory elif [ "${engine}" == "refractor" ]; then fn_info_message_refractor @@ -1324,8 +1326,6 @@ fn_info_message_select_engine(){ fn_info_message_seriousengine35 elif [ "${engine}" == "source" ]; then fn_info_message_source - elif [ "${gamename}" == "Soldier Of Fortune 2: Gold Edition" ]; then - fn_info_message_sof2 elif [ "${engine}" == "spark" ]; then fn_info_message_spark elif [ "${engine}" == "starbound" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 1adeeb7442..7dfb31378a 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -40,10 +40,10 @@ fn_default_config_remote(){ if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" - elif [ "${gamename}" == "ARMA 3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then + elif [ "${shortname}" == "arma3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then mkdir -p "${servercfgdir}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" - elif [ "${gamename}" == "Don't Starve Together" ]&&[ "${config}" == "${clustercfgdefault}" ]; then + elif [ "${shortname}" == "dst" ]&&[ "${config}" == "${clustercfgdefault}" ]; then cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" else mkdir -p "${servercfgdir}" @@ -144,514 +144,502 @@ fn_set_dst_config_vars(){ echo "" } -if [ "${gamename}" == "7 Days To Die" ]; then +if [ "${shortname}" == "sdtd" ]; then gamedirname="7DaysToDie" fn_default_config_local -elif [ "${gamename}" == "Action half-life" ]; then +elif [ "${shortname}" == "ahl" ]; then gamedirname="ActionHalfLife" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "ARK: Survival Evolved" ]; then +elif [ "${shortname}" == "ark" ]; then gamedirname="ARKSurvivalEvolved" fn_check_cfgdir array_configs+=( GameUserSettings.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "ARMA 3" ]; then +elif [ "${shortname}" == "arma3" ]; then gamedirname="Arma3" fn_check_cfgdir array_configs+=( server.cfg network.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Ballistic Overkill" ]; then +elif [ "${shortname}" == "bo" ]; then gamedirname="BallisticOverkill" array_configs+=( config.txt ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Base Defense" ]; then +elif [ "${shortname}" == "bo" ]; then gamedirname="BaseDefense" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Barotrauma" ]; then +elif [ "${shortname}" == "bt" ]; then gamedirname="Barotrauma" fn_check_cfgdir array_configs+=( serversettings.xml ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Battalion 1944" ]; then +elif [ "${shortname}" == "Battalion 1944" ]; then gamedirname="Battalion1944" fn_check_cfgdir array_configs+=( DefaultGame.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Battlefield: 1942" ]; then +elif [ "${shortname}" == "bt1942" ]; then gamedirname="Battlefield1942" array_configs+=( serversettings.con ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Blade Symphony" ]; then +elif [ "${shortname}" == "bs" ]; then gamedirname="BladeSymphony" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "BrainBread" ]; then +elif [ "${shortname}" == "bb" ]; then gamedirname="BrainBread" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "BrainBread 2" ]; then +elif [ "${shortname}" == "bb2" ]; then gamedirname="BrainBread2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Black Mesa: Deathmatch" ]; then +elif [ "${shortname}" == "bmdm" ]; then gamedirname="BlackMesa" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty" ]; then +elif [ "${shortname}" == "cod" ]; then gamedirname="CallOfDuty" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then +elif [ "${shortname}" == "coduo" ]; then gamedirname="CallOfDutyUnitedOffensive" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty 2" ]; then +elif [ "${shortname}" == "cod2" ]; then gamedirname="CallOfDuty2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty 4" ]; then +elif [ "${shortname}" == "cod4" ]; then gamedirname="CallOfDuty4" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty: World at War" ]; then +elif [ "${shortname}" == "codwaw" ]; then gamedirname="CallOfDutyWorldAtWar" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Codename CURE" ]; then +elif [ "${shortname}" == "cc" ]; then gamedirname="CodenameCURE" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike 1.6" ]; then +elif [ "${shortname}" == "cs" ]; then gamedirname="CounterStrike" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike: Condition Zero" ]; then +elif [ "${shortname}" == "cscz" ]; then gamedirname="CounterStrikeConditionZero" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then +elif [ "${shortname}" == "csgo" ]; then gamedirname="CounterStrikeGlobalOffensive" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Classic Offensive" ]; then - gamedirname="ClassicOffensive" - array_configs+=( server.cfg ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike: Source" ]; then +elif [ "${shortname}" == "css" ]; then gamedirname="CounterStrikeSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Day of Defeat" ]; then +elif [ "${shortname}" == "dod" ]; then gamedirname="DayOfDefeat" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Day of Defeat: Source" ]; then +elif [ "${shortname}" == "dods" ]; then gamedirname="DayOfDefeatSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Day of Infamy" ]; then +elif [ "${shortname}" == "doi" ]; then gamedirname="DayOfInfamy" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Deathmatch Classic" ]; then +elif [ "${shortname}" == "dmc" ]; then gamedirname="DeathmatchClassic" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Don't Starve Together" ]; then +elif [ "${shortname}" == "dst" ]; then gamedirname="DontStarveTogether" fn_check_cfgdir array_configs+=( cluster.ini server.ini ) fn_fetch_default_config fn_default_config_remote fn_set_dst_config_vars -elif [ "${gamename}" == "Double Action: Boogaloo" ]; then +elif [ "${shortname}" == "dab" ]; then gamedirname="DoubleActionBoogaloo" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Dystopia" ]; then +elif [ "${shortname}" == "dys" ]; then gamedirname="Dystopia" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Eco" ]; then +elif [ "${shortname}" == "eco" ]; then gamedirname="Eco" array_configs+=( Network.eco ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "ET: Legacy" ]; then +elif [ "${shortname}" == "etl" ]; then gamedirname="ETLegacy" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Factorio" ]; then +elif [ "${shortname}" == "fctr" ]; then gamedirname="Factorio" array_configs+=( server-settings.json ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Fistful of Frags" ]; then +elif [ "${shortname}" == "fof" ]; then gamedirname="FistfulofFrags" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Garry's Mod" ]; then +elif [ "${shortname}" == "gmod" ]; then gamedirname="GarrysMod" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "GoldenEye: Source" ]; then +elif [ "${shortname}" == "ges" ]; then gamedirname="GoldenEyeSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half Life: Deathmatch" ]; then +elif [ "${shortname}" == "hldm" ]; then gamedirname="HalfLifeDeathmatch" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half-Life Deathmatch: Source" ]; then +elif [ "${shortname}" == "hldms" ]; then gamedirname="HalfLifeDeathmatchSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half-Life: Opposing Force" ]; then +elif [ "${shortname}" == "opfor" ]; then gamedirname="OpposingForce" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then +elif [ "${shortname}" == "hl2dm" ]; then gamedirname="HalfLife2Deathmatch" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Insurgency" ]; then +elif [ "${shortname}" == "ins" ]; then gamedirname="Insurgency" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "IOSoccer" ]; then +elif [ "${shortname}" == "ios" ]; then gamedirname="IOSoccer" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Just Cause 2" ]; then +elif [ "${shortname}" == "jc2" ]; then gamedirname="JustCause2" array_configs+=( config.lua ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Just Cause 3" ]; then +elif [ "${shortname}" == "jc3" ]; then gamedirname="JustCause3" array_configs+=( config.json ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Killing Floor" ]; then +elif [ "${shortname}" == "kf" ]; then gamedirname="KillingFloor" array_configs+=( Default.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Left 4 Dead" ]; then - gamedirname="Left4Dead" - array_configs+=( server.cfg ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars -elif [ "${gamename}" == "Left 4 Dead" ]; then +elif [ "${shortname}" == "l4d" ]; then gamedirname="Left4Dead" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Left 4 Dead 2" ]; then +elif [ "${shortname}" == "l4d2" ]; then gamedirname="Left4Dead2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Minecraft" ]; then +elif [ "${shortname}" == "mc" ]; then gamedirname="Minecraft" array_configs+=( server.properties ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "MORDHAU" ]; then +elif [ "${shortname}" == "mh" ]; then gamedirname="Mordhau" fn_check_cfgdir array_configs+=( Game.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Natural Selection" ]; then +elif [ "${shortname}" == "ns" ]; then gamedirname="NaturalSelection" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "No More Room in Hell" ]; then +elif [ "${shortname}" == "nmrih" ]; then gamedirname="NoMoreRoominHell" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Nuclear Dawn" ]; then +elif [ "${shortname}" == "nd" ]; then gamedirname="NuclearDawn" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Multi Theft Auto" ]; then +elif [ "${shortname}" == "mta" ]; then gamedirname="MultiTheftAuto" fn_check_cfgdir array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Mumble" ]; then +elif [ "${shortname}" == "mumble" ]; then gamedirname="Mumble" array_configs+=( murmur.ini ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then +elif [ "${shortname}" == "pvkii" ]; then gamedirname="PiratesVikingandKnightsII" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Project Zomboid" ]; then +elif [ "${shortname}" == "pz" ]; then gamedirname="ProjectZomboid" fn_check_cfgdir array_configs+=( server.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Project Cars" ]; then +elif [ "${shortname}" == "pc" ]; then gamedirname="ProjectCars" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Quake 2" ]; then +elif [ "${shortname}" == "q2" ]; then gamedirname="Quake2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Quake 3: Arena" ]; then +elif [ "${shortname}" == "q3" ]; then gamedirname="Quake3Arena" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Quake Live" ]; then +elif [ "${shortname}" == "ql" ]; then gamedirname="QuakeLive" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "QuakeWorld" ]; then +elif [ "${shortname}" == "qw" ]; then gamedirname="QuakeWorld" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Ricochet" ]; then +elif [ "${shortname}" == "ricochet" ]; then gamedirname="Ricochet" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then +elif [ "${shortname}" == "rtcw" ]; then gamedirname="ReturnToCastleWolfenstein" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Rust" ]; then +elif [ "${shortname}" == "rust" ]; then gamedirname="Rust" fn_check_cfgdir array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "San Andreas Multiplayer" ]; then +elif [ "${shortname}" == "samp" ]; then gamedirname="SanAndreasMultiplayer" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then +elif [ "${shortname}" == "ss3" ]; then gamedirname="SeriousSam3BFE" array_configs+=( server.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Soldat" ]; then +elif [ "${shortname}" == "sol" ]; then gamedirname="Soldat" array_configs+=( soldat.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Soldier Of Fortune 2: Gold Edition" ]; then +elif [ "${shortname}" == "sof2" ]; then gamedirname="SoldierOfFortune2Gold" array_configs+=( server.cfg mapcycle.txt) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "SourceForts Classic" ]; then +elif [ "${shortname}" == "sfc" ]; then gamedirname="SourceFortsClassic" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Squad" ]; then +elif [ "${shortname}" == "squad" ]; then gamedirname="Squad" array_configs+=( Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Starbound" ]; then +elif [ "${shortname}" == "sb" ]; then gamedirname="Starbound" array_configs+=( starbound_server.config ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Stationeers" ]; then +elif [ "${shortname}" == "st" ]; then gamedirname="Stationeers" array_configs+=( default.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Sven Co-op" ]; then +elif [ "${shortname}" == "sven" ]; then gamedirname="SvenCoop" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Team Fortress 2" ]; then +elif [ "${shortname}" == "tf2" ]; then gamedirname="TeamFortress2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Team Fortress Classic" ]; then +elif [ "${shortname}" == "tfc" ]; then gamedirname="TeamFortressClassic" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "The Specialists" ]; then +elif [ "${shortname}" == "ts" ]; then gamedirname="TheSpecialists" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "TeamSpeak 3" ]; then +elif [ "${shortname}" == "ts3" ]; then gamedirname="TeamSpeak3" array_configs+=( ts3server.ini ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Teeworlds" ]; then +elif [ "${shortname}" == "tw" ]; then gamedirname="Teeworlds" array_configs+=( server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Terraria" ]; then +elif [ "${shortname}" == "terraria" ]; then gamedirname="Terraria" array_configs+=( serverconfig.txt ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Tower Unite" ]; then +elif [ "${shortname}" == "tu" ]; then gamedirname="TowerUnite" fn_check_cfgdir array_configs+=( TowerServer.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Unreal Tournament" ]; then +elif [ "${shortname}" == "ut" ]; then gamedirname="UnrealTournament" array_configs+=( Game.ini Engine.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Unreal Tournament 2004" ]; then +elif [ "${shortname}" == "ut2k4" ]; then gamedirname="UnrealTournament2004" array_configs+=( UT2004.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Unreal Tournament 99" ]; then +elif [ "${shortname}" == "ut99" ]; then gamedirname="UnrealTournament99" array_configs+=( Default.ini ) fn_fetch_default_config @@ -663,31 +651,31 @@ elif [ "${shortname}" == "unt" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Vampire Slayer" ]; then +elif [ "${shortname}" == "vs" ]; then gamedirname="VampireSlayer" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then +elif [ "${shortname}" == "wet" ]; then gamedirname="WolfensteinEnemyTerritory" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Wurm Unlimited" ]; then +elif [ "${shortname}" == "wurm" ]; then gamedirname="WurmUnlimited" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Zombie Master: Reborn" ]; then +elif [ "${shortname}" == "zmr" ]; then gamedirname="ZombieMasterReborn" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Zombie Panic! Source" ]; then +elif [ "${shortname}" == "zps" ]; then gamedirname="ZombiePanicSource" array_configs+=( server.cfg ) fn_fetch_default_config diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index 18255ebd81..cd8fe8c218 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -24,4 +24,4 @@ if [ -z "${autoinstall}" ]; then fi if [ ! -d "${serverfiles}" ]; then mkdir -v "${serverfiles}" -fi \ No newline at end of file +fi diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 3de499a4c5..295a81cd7a 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -72,7 +72,7 @@ fn_install_server_files_steamcmd(){ counter="0" while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do counter=$((counter+1)) - cd "${steamcmddir}" + cd "${steamcmddir}" || exit if [ "${counter}" -le "10" ]; then # Attempt 1-4: Standard attempt. # Attempt 5-6: Validate attempt. diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/functions/install_squad_license.sh index f9cf40835c..f5d5dc457a 100644 --- a/lgsm/functions/install_squad_license.sh +++ b/lgsm/functions/install_squad_license.sh @@ -23,4 +23,4 @@ echo "" fn_sleep_time echo "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." fn_script_log_info "The Squad server license can be changed by editing ${selfname}." -echo "" \ No newline at end of file +echo "" diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index c4de5e8c86..280b50a92e 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -28,7 +28,7 @@ if [ "${status}" != "0" ]&&[ "${function_selfname}" == "command_start.sh" ]&&[ - fi # Log manager will start the cleanup if it finds logs older than "${logdays}". -if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; then +if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; then fn_print_dots "Starting" # Set common logs directories commonlogs="${systemdir}/logs" @@ -81,7 +81,7 @@ if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; th find "${sourcemodlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi # Garry's Mod logfiles. - if [ "${gamename}" == "Garry's Mod" ]; then + if [ "${shortname}" == "gmod" ]; then # ULX logfiles. if [ -d "${ulxlogdir}" ]; then find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index d2e18d6bf9..02d95c2f04 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -43,7 +43,7 @@ fn_mod_lowercase(){ fileswc=$(find "${extractdir}" -depth | wc -l) echo -en "\r" while read -r src; do - dst=$(dirname "${src}"$(/)basename "${src}" | tr 'A-Z' 'a-z') + dst="$(dirname "${src}$(/)basename" "${src}" | tr 'A-Z' 'a-z')" if [ "${src}" != "${dst}" ] then [ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo "${src} was not renamed" diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 56d55206f5..39e8d884a4 100644 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -10,7 +10,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; if [ "${engine}" == "idtech3_ql" ]; then local engine="quakelive" - elif [ "${gamename}" == "Killing Floor 2" ]; then + elif [ "${shortname}" == "kf2" ]; then local engine="unreal4" fi diff --git a/linuxgsm.sh b/linuxgsm.sh index 3bebf57714..cc9ec81be0 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -151,7 +151,7 @@ fn_install_menu_bash() { while read -r line || [[ -n "${line}" ]]; do var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 5901a7e29d..6c74712ccd 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -162,7 +162,7 @@ fn_install_menu_bash() { while read -r line || [[ -n "${line}" ]]; do var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index e0a9cd8264..8aa9e09ccb 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -160,7 +160,7 @@ fn_install_menu_bash() { while read -r line || [[ -n "${line}" ]]; do var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 7853a96904..df76274fb8 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -160,7 +160,7 @@ fn_install_menu_bash() { while read -r line || [[ -n "${line}" ]]; do var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index b6bbd5edc8..c0d257059e 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -160,7 +160,7 @@ fn_install_menu_bash() { while read -r line || [[ -n "${line}" ]]; do var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then