diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..ef3ef8bd9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. +# Atom: Please assure your Atom's config setting Tab Type is set to auto, otherwise Atom-EditorConfig may not work as expected. Also disable whitespace package. +# http://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true +end_of_line = lf +insert_final_newline = true diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f69856e5f..72eb679f9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,7 @@ + --- name: Bug report -about: Create a report to help us improve +about: Found a bug? Raise a report --- @@ -8,18 +9,27 @@ Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you po For general support visit the **[steam group](https://linuxgsm.com/steam)**. GitHub is **ONLY** for: +``` * LinuxGSM bugs * feature suggestions * code contributions +``` GitHub is **NOT** for: +``` * General support * Specific game server issues (e.g CS:GO, TF2) * Dedicated server issues (e.g Ubuntu, CentOS) * Anything not directly related to LinuxGSM development - +``` Any general support issues on GitHub will be closed. +*Please use the template below* + +**Basic info** +Game: +Distro: + **Describe the bug** A clear and concise description of what the bug is. @@ -33,7 +43,7 @@ Steps to reproduce the behaviour: **Expected behaviour** A clear and concise description of what you expected to happen. -** Minimum Information ** +**Minimum Information** The game server you are running (e.g. Rust/CS:GO). The link from `./gameserver postdetails` command. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 6ba0c2bd2..9e6f49b49 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -20,6 +20,12 @@ GitHub is **NOT** for: Any general support issues on GitHub will be closed. +*Please use the template below* + +**Basic info** +Game: +Distro: + **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/.github/ISSUE_TEMPLATE/new-server-request.md b/.github/ISSUE_TEMPLATE/new-server-request.md index 6ce2f50d1..f528da120 100644 --- a/.github/ISSUE_TEMPLATE/new-server-request.md +++ b/.github/ISSUE_TEMPLATE/new-server-request.md @@ -4,13 +4,13 @@ about: Suggest a new game server to be added --- -**What game server Would you like adding?** +**What game server would you like adding?** **Can you link to any tutorials or guides?** Any useful guides will help with development **Is the server on Steam?** -If yes Use SteamDB to get the appid. https://steamdb.info/ +If yes Use SteamDB to get the appid. (https://steamdb.info) **Is the server supported on Linux?** -We only support Linux servers and dont support Wine. +We only support Linux servers and do not support Wine. \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..1387c5e19 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,4 @@ +template: | + ## Changelog + + $CHANGES \ No newline at end of file diff --git a/.github/topissuebot.yml b/.github/topissuebot.yml new file mode 100644 index 000000000..b02540a2d --- /dev/null +++ b/.github/topissuebot.yml @@ -0,0 +1,4 @@ +# Configuration for top-issue-bot +labelName: ":thumbsup: Top Issue!" +labelColor: "f442c2" +numberOfIssuesToLabel: 5 \ No newline at end of file diff --git a/.github/write-good.yml b/.github/write-good.yml new file mode 100644 index 000000000..2bdb512ad --- /dev/null +++ b/.github/write-good.yml @@ -0,0 +1,4 @@ +# .github/write-good.yml +writeGood: true +alex: true +spellchecker: true \ No newline at end of file diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index e57c873d1..9440ef4b0 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -13,12 +13,13 @@ ip="0.0.0.0" port="7777" queryport="27015" rconport="27020" +# Default Map: TheIsland, Ragnarok, CrystalIsles, Aberration_P, ScorchedEarth_P defaultmap="TheIsland" maxplayers="70" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters fn_parms(){ -parms="\"${defaultmap}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?\"" +parms="\"${defaultmap}?AltSaveDirectoryName=${defaultmap}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port} -automanagedmods\"" } #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index c19233e41..7cbdb93f6 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -10,14 +10,14 @@ ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters # https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server -# [Game Modes] gametype gamemode -# Arms Race 1 0 -# Classic Casual 0 0 -# Classic Competitive 0 1 +# [Game Modes] gametype gamemode mapgroup (you can mix these across Game Modes, but use only one) +# Arms Race 1 0 mg_armsrace +# Classic Casual 0 0 mg_casualsigma, mg_casualdelta +# Classic Competitive 0 1 mg_active, mg_reserves, mg_hostage, mg_de_dust2 # Custom 3 0 -# Deathmatch 1 2 -# Demolition 1 1 -# Wingman 0 2 +# Deathmatch 1 2 mg_deathmatch +# Demolition 1 1 mg_demolition +# Wingman 0 2 gametype="0" gamemode="0" mapgroup="mg_active" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 9025c5e35..6681a49a6 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -21,7 +21,7 @@ maxplayers="28" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters fn_parms(){ -parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -password=${serverpassword} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -log" +parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers}?Port=${port}?QueryPort=${queryport} -password=${serverpassword} -hostname='${servername}' -log" } #### LinuxGSM Settings #### diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 9bda41b9b..12382706f 100644 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -1,49 +1,47 @@ #!/bin/bash # LinuxGSM alert_discord.sh function # Author: Daniel Gibbs -# Contributor: faflfama +# Contributor: faflfama, diamondburned # Website: https://linuxgsm.com # Description: Sends Discord alert. +if ! command -v jq > /dev/null; then + fn_print_fail_nl "Sending Discord alert: jq is missing." + fn_script_log_fatal "Sending Discord alert: jq is missing." +fi + +escaped_servername="$(echo -n "${servername}" | jq -sRr "@json")" +escaped_alertbody="$(echo -n "${alertbody}" | jq -sRr "@json")" + json=$(cat <${alertsubject} ${alertemoji}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer name\n${servername}\n\nHostname\n${HOSTNAME}\n\nServer IP\n${ip}:${port}\n\nMore info\n${alerturl}", + "text": "${alertemoji} ${alertsubject} ${alertemoji}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer name\n${servername}\n\nHostname\n${HOSTNAME}\n\nServer IP\n${extip:-$ip}:${port}\n\nMore info\n${alerturl}", "disable_web_page_preview": "yes", EOF ) diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index d7bc5ae92..dff515742 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -8,7 +8,7 @@ local commandname="CHECK" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -e "${servercfgfullpath}" ]; then - if [ "${gamename}" != "Hurtworld" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then + if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then fn_print_dots "" sleep 0.5 fn_print_warn_nl "Configuration file missing!" @@ -20,7 +20,7 @@ if [ ! -e "${servercfgfullpath}" ]; then fi fi -if [ "${gamename}" == "Rust" ]; then +if [ "${shortname}" == "rust" ]; then if [ -z "${rconpassword}" ]; then fn_print_dots "" sleep 0.5 diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 410483480..738e24f65 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -474,7 +474,7 @@ fn_deps_build_redhat(){ # Brainbread 2, Don't Starve Together & Team Fortress 2 elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then array_deps_required+=( libcurl.i686 ) - if [ "${gamename}" == "Team Fortress 2" ]; then + if [ "${shortname}" == "tf2" ]; then array_deps_required+=( gperftools-libs.i686 ) fi # Battlefield: 1942 diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 992fd0e93..ba0fd6ece 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -7,7 +7,7 @@ local commandname="CHECK" -if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then +if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${travistest}" != "1" ]; then if [ ! -f "/bin/ip" ]; then ipcommand="/sbin/ip" else diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index b842c0de6..717e53ada 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -16,7 +16,7 @@ fn_check_logs(){ } # Create directories for the script and console logs -if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then +if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${shortname}" != "ts3" ]; then fn_check_logs fi diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 61d1d030d..529dcbf5b 100644 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -12,7 +12,7 @@ if [ "${shortname}" == "ts3" ]; then # 1: Server is running # 0: Server seems to have died # 0: No server running (ts3server.pid is missing) - status=$("${executabledir}/ts3server_startscript.sh" status servercfgfullpathfile=${servercfgfullpath}) + status=$("${executabledir}/ts3server_startscript.sh" status servercfgfullpathfile="${servercfgfullpath}") if [ "${status}" == "Server is running" ]; then status=1 else diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index e7d9a6ac9..410548987 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -10,10 +10,8 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header -if [ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "ARK: Survival Evolved" ]; then +if [ "${shortname}" == "rust" ]||[ "${shortname}" == "hw" ]||[ "${shortname}" == "ark" ]; then fn_print_information_nl "${gamename} does not produce a verbose output to the console" -fi -if [ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "ARK: Survival Evolved" ]; then fn_print_information_nl "${gamename} does not allow server commands to be entered in to the console" fi fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console." diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 453c42894..23cb49f4b 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -56,7 +56,6 @@ if [ "${multiple_ip}" == "1" ]; then else echo -e "${blue}Server IP:\t${default}${ip}:${port}" fi -echo -e "${blue}Server IP:\t${default}${ip}:${port}" # External server ip if [ -n "${extip}" ]; then if [ "${ip}" != "${extip}" ]; then diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 3474ae3ac..4b11d0658 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -24,7 +24,7 @@ fn_info_message_gameserver fn_info_message_script fn_info_message_backup # Some game servers do not have parms. -if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche2.0" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then +if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then fn_parms fn_info_message_commandlineparms fi diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/functions/command_dev_clear_functions.sh index 40f781d72..bf026ced5 100644 --- a/lgsm/functions/command_dev_clear_functions.sh +++ b/lgsm/functions/command_dev_clear_functions.sh @@ -9,7 +9,7 @@ echo "Clear Functions" echo "=================================" echo "" if fn_prompt_yn "Do you want to delete all functions?" Y; then - rm -rfv "${functionsdir}"/* - rm -rfv "${configdirdefault}"/* + rm -rfv "${functionsdir:?}/"* + rm -rfv "${configdirdefault:?}/"* fi core_exit.sh \ No newline at end of file diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index c16d517aa..af0e7de6a 100644 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -24,7 +24,7 @@ info_config.sh info_parms.sh 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/lgsm/functions/command_donate.sh b/lgsm/functions/command_donate.sh new file mode 100644 index 000000000..a277b87b6 --- /dev/null +++ b/lgsm/functions/command_donate.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM command_donate.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Shows ways to donate + +echo -e "" +echo -e "${lightyellow}Support LinuxGSM${default}" +echo -e "=================================" +echo -e "" +echo -e "Been using LinuxGSM?" +echo -e "Consider donating to support development." +echo -e "" +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 diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 630778e59..7eed4813e 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -51,7 +51,7 @@ if [ -d "${fastdldir}" ]; then fi # Garry's Mod Specific -if [ "${gamename}" == "Garry's Mod" ]; then +if [ "${shortname}" == "gmod" ]; then # Prompt for download enforcer, which is using a .lua addfile resource generator if fn_prompt_yn "Force clients to download files?" Y; then luaresource="on" @@ -152,7 +152,7 @@ fn_fastdl_preview(){ echo -e "analysing required files" fn_script_log_info "Analysing required files" # Garry's Mod - if [ "${gamename}" == "Garry's Mod" ]; then + if [ "${shortname}" == "gmod" ]; then cd "${systemdir}" || exit allowed_extentions_array=( "*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav" ) for allowed_extention in "${allowed_extentions_array[@]}"; do @@ -207,7 +207,7 @@ fn_fastdl_preview(){ sleep 0.5 totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size - while read dufile; do + while read -r dufile; do filesize=$(stat -c %s "${dufile}") filesizetotal=$(( ${filesizetotal} + ${filesize} )) exitcode=$? @@ -358,7 +358,7 @@ fn_fastdl_build(){ # Copy all needed files for FastDL echo -e "copying files to ${fastdldir}" fn_script_log_info "Copying files to ${fastdldir}" - if [ "${gamename}" == "Garry's Mod" ]; then + if [ "${shortname}" == "gmod" ]; then fn_fastdl_gmod fn_fastdl_gmod_dl_enforcer else @@ -387,7 +387,7 @@ fn_fastdl_gmod_dl_enforcer(){ echo -en "creating new download enforcer: ${luafastdlfile}..." touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path - while read line; do + while read -r line; do echo "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') exitcode=$? diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index ba4059649..78b0e5441 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -19,7 +19,7 @@ else check_deps.sh installflag=1 # Download and install - if [ "${gamename}" == "Unreal Tournament 2004" ]; then + if [ "${shortname}" == "ut2k4" ]; then install_server_files.sh install_ut2k4_key.sh elif [ -z "${appid}" ]; then @@ -32,15 +32,15 @@ else # Configuration install_config.sh - if [ "${gamename}" == "BrainBread 2" ]||[ "${gamename}" == "Black Mesa: Deathmatch" ]||[ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Empires Mod" ]||[ "${gamename}" == "Garry’s Mod" ]||[ "${gamename}" == "No more Room in Hell" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "Tower Unite" ]; then + if [ "${shortname}" == "bb2" ]||[ "${shortname}" == "bmdm" ]||[ "${shortname}" == "csgo" ]||[ "${shortname}" == "em" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "tf2" ]||[ "${shortname}" == "tu" ]; then install_gslt.sh - elif [ "${gamename}" == "Don't Starve Together" ]; then + elif [ "${shortname}" == "dst" ]; then install_dst_token.sh - elif [ "${gamename}" == "Squad" ]; then + elif [ "${shortname}" == "squad" ]; then install_squad_license.sh - elif [ "${gamename}" == "TeamSpeak 3" ]; then + elif [ "${shortname}" == "ts3" ]; then install_ts3db.sh - elif [ "${gamename}" == "Multi Theft Auto" ]; then + elif [ "${shortname}" == "mta" ]; then command_install_resources_mta.sh fi diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index c4b9f9a42..2a291cd15 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -110,9 +110,9 @@ fn_monitor_check_session(){ fn_print_ok_eol_nl fn_script_log_pass "Checking session: OK" else - if [ "${gamename}" == "TeamSpeak 3" ]; then + if [ "${shortname}" == "ts3" ]; then fn_print_error "Checking session: ${ts3error}: " - elif [ "${gamename}" == "Mumble" ]; then + elif [ "${shortname}" == "mumble" ]; then fn_print_error "Checking session: Not listening to port ${queryport}" else fn_print_error "Checking session: " @@ -137,7 +137,7 @@ fn_monitor_query(){ if [ "${allowed_engine}" == "${engine}" ]; then if [ "${engine}" == "idtech3_ql" ]; then local engine="quakelive" - elif [ "${gamename}" == "Killing Floor 2" ]; then + elif [ "${shortname}" == "kf2" ]; then local engine="unreal4" fi @@ -186,7 +186,7 @@ fn_monitor_check_lockfile fn_monitor_check_update fn_monitor_check_session # Query has to be enabled in Starbound config -if [ "${gamename}" == "Starbound" ]; then +if [ "${shortname}" == "sb" ]; then if [ "${queryenabled}" == "true" ]; then fn_monitor_query fi diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index 1c47f0a64..a4a0b96c4 100644 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -68,7 +68,7 @@ else fn_info_message_script fn_info_message_backup # Some game servers do not have parms. - if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche2.0" ]&&[ "${engine}" != "avalanche3.0" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then + if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then fn_parms fn_info_message_commandlineparms fi diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 30c425c51..77c25ee8f 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -214,7 +214,7 @@ if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateon command_update.sh fi -if [ "${gamename}" == "TeamSpeak 3" ]; then +if [ "${shortname}" == "ts3" ]; then fn_start_teamspeak3 else fn_start_tmux diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 72641d2d2..f9042a4a5 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -174,22 +174,22 @@ fn_stop_graceful_sdtd(){ } fn_stop_graceful_select(){ - if [ "${gamename}" == "7 Days To Die" ]; then + if [ "${shortname}" == "sdtd" ]; then fn_stop_graceful_sdtd elif [ "${engine}" == "Spark" ]; then fn_stop_graceful_cmd "q" 30 - elif [ "${gamename}" == "Terraria" ]; then + elif [ "${shortname}" == "terraria" ]; then fn_stop_graceful_cmd "exit" 30 - elif [ "${gamename}" == "Minecraft" ]; then + elif [ "${shortname}" == "mc" ]; then fn_stop_graceful_cmd "stop" 30 - elif [ "${gamename}" == "Multi Theft Auto" ]; then + elif [ "${shortname}" == "mta" ]; then # we need a long wait time here as resources are stopped individually and process their own shutdowns fn_stop_graceful_cmd "quit" 120 elif [ "${engine}" == "goldsource" ]; then fn_stop_graceful_goldsource - elif [ "${engine}" == "avalanche2.0" ]||[ "${engine}" == "avalanche3.0" ]||[ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]||[ "${shortname}" == "wurm" ]; then + elif [ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${shortname}" == "fctr" ]||[ "${shortname}" == "mumble" ]||[ "${shortname}" == "wurm" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "jc3" ]; then fn_stop_graceful_ctrlc - elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]||[ "${engine}" == "projectzomboid" ]||[ "${shortname}" == "rw" ]; then + elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "pz" ]||[ "${shortname}" == "rw" ]; then fn_stop_graceful_cmd "quit" 30 fi } @@ -212,9 +212,7 @@ fn_stop_ark(){ if [ "${#queryport}" -gt 0 ] ; then for (( pidcheck=0 ; pidcheck < ${maxpiditer} ; pidcheck++ )) ; do - pid=$(netstat -nap 2>/dev/null | grep "^udp[[:space:]]" |\ - grep ":${queryport}[[:space:]]" | rev | awk '{print $1}' |\ - rev | cut -d\/ -f1) + pid=$(netstat -nap 2>/dev/null | grep "^udp[[:space:]]" | grep ":${queryport}[[:space:]]" | rev | awk '{print $1}' | rev | cut -d\/ -f1) # # check for a valid pid pid=${pid//[!0-9]/} @@ -263,7 +261,7 @@ fn_stop_tmux(){ if [ "${status}" == "0" ]; then # ARK doesn't clean up immediately after tmux is killed. # Make certain the ports are cleared before continuing. - if [ "${gamename}" == "ARK: Survival Evolved" ]; then + if [ "${shortname}" == "ark" ]; then fn_stop_ark fi fn_print_ok_nl "${servername}" @@ -280,7 +278,7 @@ fn_stop_pre_check(){ if [ "${status}" == "0" ]; then # $status comes from check_status.sh, which is run by check.sh for this command fn_print_info_nl "${servername} is already stopped" fn_script_log_error "${servername} is already stopped" - elif [ "${gamename}" == "TeamSpeak 3" ]; then + elif [ "${shortname}" == "ts3" ]; then fn_stop_teamspeak3 else fn_stop_graceful_select diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index de180118a..9c366ae61 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -9,19 +9,19 @@ local commandaction="Update" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "" -sleep 0.5 +sleep 0.2 check.sh logs.sh -if [ "${gamename}" == "TeamSpeak 3" ]; then +if [ "${shortname}" == "ts3" ]; then update_ts3.sh -elif [ "${engine}" == "lwjgl2" ]; then +elif [ "${shortname}" == "mc" ]; then update_minecraft.sh -elif [ "${gamename}" == "Mumble" ]; then +elif [ "${shortname}" == "mumble" ]; then update_mumble.sh -elif [ "${gamename}" == "Factorio" ]; then +elif [ "${shortname}" == "fctr" ]; then update_factorio.sh -elif [ "${gamename}" == "Multi Theft Auto" ]; then +elif [ "${shortname}" == "mta" ]; then update_mta.sh else update_steamcmd.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index a93d59d66..2e9dab18b 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -51,17 +51,9 @@ if [ "${status}" != "0" ]; then exitbypass=1 command_stop.sh fn_validation "${appid}" - # will also check for second appid - if [ "${gamename}" == "Classic Offensive" ]; then - fn_validation "${appid_co}" - fi exitbypass=1 command_start.sh else fn_validation - # will also check for second appid - if [ "${gamename}" == "Classic Offensive" ]; then - fn_validation "${appid_co}" - fi fi core_exit.sh diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index 69d0140f3..b476f4da3 100644 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -43,7 +43,7 @@ fn_wipe_exit_code(){ # Removes files to wipe server fn_wipe_server_remove_files(){ # Rust Wipe - if [ "${gamename}" == "Rust" ]; then + if [ "${shortname}" == "rust" ]; then # Wipe pocedural map if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.map" @@ -188,7 +188,7 @@ fn_wipe_server_remove_files(){ # Check if there is something to wipe, prompt the user, and call appropriate functions # Rust Wipe -if [ "${gamename}" == "Rust" ]; then +if [ "${shortname}" == "rust" ]; then if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "barren*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then fn_print_warning_nl "Any user, storage, log and map data from ${serveridentitydir} will be erased." if ! fn_prompt_yn "Continue?" Y; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index f4b27fdd1..416835504 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -51,6 +51,12 @@ fn_fetch_function # Commands + +command_backup.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + command_console.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -61,22 +67,22 @@ functionfile="${FUNCNAME}" fn_fetch_function } -command_postdetails.sh(){ +command_details.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -command_details.sh(){ +command_donate.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -command_test_alert.sh(){ +command_postdetails.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } -command_backup.sh(){ +command_test_alert.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 07b5e71f9..7be0f8d66 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -20,6 +20,7 @@ cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the serve cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." ) cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." ) cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." ) +cmd_donate=( "do;donate" "command_donate.sh" "Donation options." ) # Console servers only cmd_console=( "c;console" "command_console.sh" "Access server console." ) cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." ) @@ -51,6 +52,7 @@ cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect require cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." ) cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) + ### Set specific opt here ### currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" ) @@ -59,10 +61,10 @@ currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monit currentopt+=( "${cmd_update_linuxgsm[@]}" ) # Exclude noupdate games here -if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${gamename}" != "San Andreas Multiplayer" ]; then +if [ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${shortname}" != "bf1942" ]&&[ "${shortname}" != "samp" ]; then currentopt+=( "${cmd_update[@]}" ) # force update for SteamCMD only or MTA - if [ -n "${appid}" ]||[ "${gamename}" == "Multi Theft Auto" ]; then + if [ -n "${appid}" ]||[ "${shortname}" == "mta" ]; then currentopt+=( "${cmd_force_update[@]}" ) fi fi @@ -76,7 +78,7 @@ fi currentopt+=( "${cmd_backup[@]}" ) # Exclude games without a console -if [ "${gamename}" != "TeamSpeak 3" ]; then +if [ "${shortname}" != "ts3" ]; then currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) fi @@ -88,16 +90,16 @@ if [ "${engine}" == "source" ]; then fi # TeamSpeak exclusive -if [ "${gamename}" == "TeamSpeak 3" ]; then +if [ "${shortname}" != "ts3" ]; then currentopt+=( "${cmd_change_password[@]}" ) fi # Unreal exclusive -if [ "${gamename}" == "Rust" ]; then +if [ "${shortname}" == "rust" ]; then currentopt+=( "${cmd_wipe[@]}" "${cmd_wipeall[@]}" ) fi if [ "${engine}" == "unreal2" ]; then - if [ "${gamename}" == "Unreal Tournament 2004" ]; then + if [ "${shortname}" == "ut2k4" ]; then currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) else currentopt+=( "${cmd_map_compressor_u2[@]}" ) @@ -108,22 +110,22 @@ if [ "${engine}" == "unreal" ]; then fi # DST exclusive -if [ "${gamename}" == "Don't Starve Together" ]; then +if [ "${shortname}" == "dst" ]; then currentopt+=( "${cmd_install_dst_token[@]}" ) fi # MTA exclusive -if [ "${gamename}" == "Multi Theft Auto" ]; then +if [ "${shortname}" == "mta" ]; then currentopt+=( "${cmd_install_default_resources[@]}" ) fi # Squad license exclusive -if [ "${gamename}" == "Squad" ]; then +if [ "${shortname}" == "squad" ]; then currentopt+=( "${cmd_install_squad_license[@]}" ) fi ## Mods commands -if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "7 Days To Die" ]; then +if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]; then currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) fi @@ -136,6 +138,9 @@ if [ -f ".dev-debug" ]; then currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}" ) fi +## Donate +currentopt+=( "${cmd_donate[@]}" ) + ### Build list of available commands optcommands=() index="0" @@ -150,7 +155,7 @@ done fn_opt_usage(){ echo "Usage: $0 [option]" echo -e "" - echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "LinuxGSM - ${gamename} - Version ${version}" echo "https://linuxgsm.com/${gameservername}" echo -e "" echo -e "${lightyellow}Commands${default}" diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 0653dcaad..dfa9fde78 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -42,25 +42,25 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th fix_steamcmd.sh fi - if [ "${gamename}" == "ARMA 3" ]; then + if [ "${shortname}" == "arma3" ]; then fix_arma3.sh elif [ "${shortname}" == "ark" ]; then fix_ark.sh - elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then + elif [ "${shortname}" == "csgo" ]; then fix_csgo.sh - elif [ "${gamename}" == "Don't Starve Together" ]; then + elif [ "${shortname}" == "dst" ]; then fix_dst.sh - elif [ "${gamename}" == "GoldenEye: Source" ]; then + elif [ "${shortname}" == "ges" ]; then fix_ges.sh - elif [ "${gamename}" == "Insurgency" ]; then + elif [ "${shortname}" == "ins" ]; then fix_ins.sh - elif [ "${gamename}" == "Rust" ]; then + elif [ "${shortname}" == "rust" ]; then fix_rust.sh elif [ "${shortname}" == "rw" ]; then fix_rw.sh elif [ "${shortname}" == "ss3" ]; then fix_ss3.sh - elif [ "${gamename}" == "Multi Theft Auto" ]; then + elif [ "${shortname}" == "mta" ]; then fix_mta.sh elif [ "${shortname}" == "wurm" ]; then fix_wurm.sh @@ -73,19 +73,19 @@ if [ "${function_selfname}" == "command_install.sh" ]; then echo "Applying Post-Install Fixes" echo "=================================" sleep 0.5 - if [ "${gamename}" == "Killing Floor" ]; then + if [ "${shortname}" == "kf" ]; then fix_kf.sh - elif [ "${gamename}" == "Killing Floor 2" ]; then + elif [ "${shortname}" == "kf2" ]; then fix_kf2.sh - elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then + elif [ "${shortname}" == "ro" ]; then fix_ro.sh - elif [ "${gamename}" == "Unreal Tournament 2004" ]; then + elif [ "${shortname}" == "ut2k4" ]; then fix_ut2k4.sh - elif [ "${gamename}" == "Unreal Tournament" ]; then + elif [ "${shortname}" == "ut" ]; then fix_ut.sh - elif [ "${gamename}" == "Unreal Tournament 3" ]; then + elif [ "${shortname}" == "ut3" ]; then fix_ut3.sh - elif [ "${gamename}" == "Team Fortress 2" ]; then + elif [ "${shortname}" == "tf2" ]; then fix_tf2.sh else fn_print_information_nl "No fixes required." diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 3a63b1505..9802c702f 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -17,7 +17,7 @@ if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then fn_fix_msg_end fi -if [ "${gamename}" == "Serious Sam 3: BFE" ]; then +if [ "${shortname}" == "ss3" ]; then # Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then fixname="libsteam.so" @@ -26,7 +26,7 @@ if [ "${gamename}" == "Serious Sam 3: BFE" ]; then cp -v "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}" fn_fix_msg_end fi -elif [ "${gamename}" == "Hurtworld" ]; then +elif [ "${shortname}" == "hw" ]; then # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then fixname="steamclient.so x86" @@ -40,7 +40,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then cp -v "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" fn_fix_msg_end fi -elif [ "${gamename}" == "Tower Unite" ]; then +elif [ "${shortname}" == "tu" ]; then # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. if [ ! -f "${executabledir}/steamclient.so" ]; then fixname="steamclient.so" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 5753bc1df..6116fa144 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -1127,109 +1127,109 @@ fn_info_config_stationeers(){ } # ARK: Survival Evolved -if [ "${gamename}" == "ARK: Survivial Evolved" ]; then +if [ "${shortname}" == "ark" ]; then fn_info_config_ark # Ballistic Overkill -elif [ "${gamename}" == "Ballistic Overkill" ]; then +elif [ "${shortname}" == "bo" ]; then fn_info_config_ballistic_overkill # Battalion 1944 -elif [ "${gamename}" == "Battalion 1944" ]; then +elif [ "${shortname}" == "bt1944" ]; then fn_info_config_battalion1944 # Battlefield: 1942 -elif [ "${gamename}" == "Battlefield: 1942" ]; then +elif [ "${shortname}" == "bf1942" ]; then fn_info_config_bf1942 # Call of Duty -elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]; then +elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then fn_info_config_cod # Call of Duty 2 -elif [ "${gamename}" == "Call of Duty 2" ]; then +elif [ "${shortname}" == "cod2" ]; then fn_info_config_cod2 # Call of Duty 4 -elif [ "${gamename}" == "Call of Duty 4" ]; then +elif [ "${shortname}" == "cod4" ]; then fn_info_config_cod4 # Call of Duty: World at War -elif [ "${gamename}" == "Call of Duty: World at War" ]; then +elif [ "${shortname}" == "codwaw" ]; then fn_info_config_codwaw # Dont Starve Together -elif [ "${engine}" == "dontstarve" ]; then +elif [ "${shortname}" == "dst" ]; then fn_info_config_dontstarve # Eco elif [ "${shortname}" == "eco" ]; then fn_info_config_eco # Factorio -elif [ "${gamename}" == "Factorio" ]; then +elif [ "${shortname}" == "fctr" ]; then fn_info_config_factorio # Insurgency: Sandstorm elif [ "${shortname}" == "inss" ]; then fn_info_config_inss # Just Cause 2 -elif [ "${gamename}" == "Just Cause 2" ]; then +elif [ "${shortname}" == "jc2" ]; then fn_info_config_justcause2 # Just Cause 3 -elif [ "${gamename}" == "Just Cause 3" ]; then +elif [ "${shortname}" == "jc3" ]; then fn_info_config_justcause3 # Killing Floor 2 elif [ "${shortname}" == "kf2" ]; then fn_info_config_kf2 # QuakeWorld -elif [ "${gamename}" == "QuakeWorld" ]; then +elif [ "${shortname}" == "qw" ]; then fn_info_config_quakeworld # Quake 2 -elif [ "${gamename}" == "Quake 2" ]; then +elif [ "${shortname}" == "q2" ]; then fn_info_config_quake2 # Quake 3 -elif [ "${gamename}" == "Quake 3: Arena" ]; then +elif [ "${shortname}" == "q3" ]; then fn_info_config_quake3 # Quake Live -elif [ "${gamename}" == "Quake Live" ]; then +elif [ "${shortname}" == "ql" ]; then fn_info_config_quakelive # Minecraft -elif [ "${engine}" == "lwjgl2" ]; then +elif [ "${shortname}" == "mc" ]; then fn_info_config_minecraft # Post Scriptum: The Bloody Seventh elif [ "${shortname}" == "pstbs" ]; then fn_info_config_pstbs # Project Cars -elif [ "${gamename}" == "Project Cars" ]; then +elif [ "${shortname}" == "pc" ]; then fn_info_config_projectcars # Project Zomboid -elif [ "${engine}" == "projectzomboid" ]; then +elif [ "${shortname}" == "pz" ]; then fn_info_config_projectzomboid # ARMA 3 -elif [ "${engine}" == "realvirtuality" ]; then +elif [ "${shortname}" == "arma3" ]; then fn_info_config_realvirtuality # Rising World elif [ "${shortname}" == "rw" ]; then fn_info_config_risingworld # Serious Sam -elif [ "${engine}" == "seriousengine35" ]; then +elif [ "${shortname}" == "ss3" ]; then fn_info_config_seriousengine35 # Source Engine Games elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then fn_info_config_source # Starbound -elif [ "${engine}" == "starbound" ]; then +elif [ "${shortname}" == "sb" ]; then fn_info_config_starbound # TeamSpeak 3 -elif [ "${gamename}" == "TeamSpeak 3" ]; then +elif [ "${shortname}" == "ts3" ]; then fn_info_config_teamspeak3 # Mumble -elif [ "${gamename}" == "Mumble" ]; then +elif [ "${shortname}" == "mumble" ]; then fn_info_config_mumble # San Andreas Multiplayer -elif [ "${gamename}" == "San Andreas Multiplayer" ]; then +elif [ "${shortname}" == "samp" ]; then fn_info_config_samp # StickyBots elif [ "${shortname}" == "pstbs" ]; then fn_info_config_sbots # Teeworlds -elif [ "${engine}" == "teeworlds" ]; then +elif [ "${shortname}" == "tw" ]; then fn_info_config_teeworlds # Terraria -elif [ "${engine}" == "terraria" ]; then +elif [ "${shortname}" == "terraria" ]; then fn_info_config_terraria # Tower Unite -elif [ "${gamename}" == "Tower Unite" ]; then +elif [ "${shortname}" == "tu" ]; then fn_info_config_towerunite # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then @@ -1238,19 +1238,19 @@ elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then elif [ "${engine}" == "unreal3" ]; then fn_info_config_unreal3 # 7 Day To Die (unity3d) -elif [ "${gamename}" == "7 Days To Die" ]; then +elif [ "${shortname}" == "sdtd" ]; then fn_info_config_sdtd -elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then +elif [ "${shortname}" == "wet" ]; then fn_info_config_wolfensteinenemyterritory -elif [ "${gamename}" == "ET: Legacy" ]; then +elif [ "${shortname}" == "etl" ]; then fn_info_config_etlegacy -elif [ "${gamename}" == "Wurm Unlimited" ]; then +elif [ "${shortname}" == "wurm" ]; then fn_info_config_wurmunlimited -elif [ "${gamename}" == "Multi Theft Auto" ]; then +elif [ "${shortname}" == "mta" ]; then fn_info_config_mta -elif [ "${gamename}" == "Squad" ]; then +elif [ "${shortname}" == "squad" ]; then fn_info_config_squad # Stationeers -elif [ "${gamename}" == "Stationeers" ]; then +elif [ "${shortname}" == "st" ]; then fn_info_config_stationeers fi \ No newline at end of file diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 36f06c4bf..d9b6bcef6 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -206,10 +206,14 @@ fi # External IP address if [ -z "${extip}" ]; then - extip=$(${curlpath} -m 3 ifconfig.co > "${tmpdir}/extip.txt" 2>/dev/null) - if [ $? -ne 0 ]; then + extip=$(${curlpath} -4 -m 3 ifconfig.co 2>/dev/null) + exitcode=$? + # Should ifconfig.co return an error will use last known IP + if [ ${exitcode} -eq 0 ]; then + echo "${extip}" > "${tmpdir}/extip.txt" + else if [ -f "${tmpdir}/extip.txt" ]; then - echo "${tmpdir}/extip.txt" + extip=$(cat ${tmpdir}/extip.txt) else echo "x.x.x.x" fi diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 3c4dc5e53..133365fd8 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -31,6 +31,7 @@ fn_info_parms_cod(){ defaultmap=${defaultmap:-"NOT SET"} maxplayers=${maxplayers:-"0"} port=${port:-"0"} + queryport=${port:-"0"} } fn_info_parms_dst(){ @@ -162,33 +163,33 @@ fn_info_parms_kf2(){ } # ARK: Survival Evolved -if [ "${gamename}" == "ARK: Survival Evolved" ]; then +if [ "${shortname}" == "ark" ]; then fn_info_parms_ark # ARMA 3 -elif [ "${engine}" == "realvirtuality" ]; then +elif [ "${shortname}" == "arma3" ]; then fn_info_parms_realvirtuality # Call of Duty -elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then +elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then fn_info_parms_cod # Eco -elif [ "${gamename}" == "Eco" ]; then +elif [ "${shortname}" == "eco" ]; then fn_info_parms_eco # Factorio -elif [ "${gamename}" == "Factorio" ]; then +elif [ "${shortname}" == "fctr" ]; then fn_info_parms_factorio elif [ "${shortname}" == "inss" ]; then fn_info_parms_inss elif [ "${shortname}" == "kf2" ]; then fn_info_parms_kf2 # Project Zomboid -elif [ "${engine}" == "projectzomboid" ]; then +elif [ "${shortname}" == "pz" ]; then fn_info_parms_projectzomboid -elif [ "${gamename}" == "QuakeWorld" ]; then +elif [ "${shortname}" == "qw" ]; then fn_info_parms_quakeworld -elif [ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]; then +elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then fn_info_parms_quake2 # Rust -elif [ "${gamename}" == "Rust" ]; then +elif [ "${shortname}" == "rust" ]; then fn_info_parms_rust # Rising World elif [ "${shortname}" == "rw" ]; then @@ -197,14 +198,14 @@ elif [ "${shortname}" == "rw" ]; then elif [ "${shortname}" == "sbots" ]; then fn_info_parms_stickybots # Serious Sam -elif [ "${engine}" == "seriousengine35" ]; then +elif [ "${shortname}" == "ss3" ]; then fn_info_config_seriousengine35 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then fn_info_parms_source # Spark elif [ "${engine}" == "spark" ]; then fn_info_parms_spark -elif [ "${gamename}" == "Tower Unite" ]; then +elif [ "${shortname}" == "tu" ]; then fn_info_config_towerunite # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index cae416547..40c2845fc 100644 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -10,9 +10,9 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear echo "=================================" -echo "${gamename}" -echo "Linux Game Server Manager" +echo "LinuxGSM - ${gamename}" echo "by Daniel Gibbs" -echo "Contributors: http://goo.gl/qLmitD" -echo "https://linuxgsm.com" +echo "Website: https://linuxgsm.com" +echo "Contributors: https://linuxgsm.com/contrib" +echo "Donate: https://linuxgsm.com/donate" echo "=================================" diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index a67045747..e3930843b 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -72,7 +72,7 @@ fn_install_server_files_steamcmd(){ fi if [ "${counter}" -ge "7" ]; then - echo "Removing $(find ${serverfiles} -type d -print0 | grep -Ez '[^/]{30}$')" + echo "Removing $(find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$')" find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf fi if [ "${counter}" -ge "9" ]; then diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 5fd39970f..8690b3b19 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/mods_list.sh b/lgsm/functions/mods_list.sh index dcc2fbecf..eb1e2f8bf 100644 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -61,8 +61,8 @@ mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile} mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" ) # CS:GO Mods -mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "Counter Strike: Global Offensive" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)") -mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "Counter Strike: Global Offensive" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)") +mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter Strike: Global Offensive" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)") +mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter Strike: Global Offensive" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)") # Garry's Mod Addons mod_info_ulib=( MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework" ) diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 15fb0277f..480624f7b 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -157,7 +157,7 @@ fn_update_steamcmd_check(){ fi # Set branch for updateinfo - IFS=' ' read -ra branchsplits <<< ${branch} + IFS=' ' read -ra branchsplits <<< "${branch}" if [ "${#branchsplits[@]}" -gt 1 ]; then branchname="${branchsplits[1]}" else diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 44f463a61..5ff6d33f8 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -63,7 +63,7 @@ fn_update_ts3_currentbuild(){ fi # Get current build from logs - currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | grep -Ev '${rootdir}/.ts3version' | tail -1) | grep -Eo 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | sort -V | tail -1) + currentbuild=$(cat $(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | grep -Ev "${rootdir}/.ts3version" | tail -1) | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | sort -V | tail -1) if [ -z "${currentbuild}" ]; then fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found" fn_script_log_error "Checking for update: teamspeak.com: Current build version not found" @@ -74,7 +74,7 @@ fn_update_ts3_currentbuild(){ command_stop.sh exitbypass=1 command_start.sh - currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | grep -Ev '${rootdir}/.ts3version' | tail -1) | grep -Eo 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + currentbuild=$(cat $(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | grep -Ev "${rootdir}/.ts3version" | tail -1) | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}") if [ -z "${currentbuild}" ]; then fn_print_fail_nl "Checking for update: teamspeak.com: Current build version still not found" fn_script_log_fatal "Checking for update: teamspeak.com: Current build version still not found"