Browse Source

refactor: shortname variable change (#2088)

* change `${gamename}` to `${shortname}`
* apply shellcheck recommendations
pull/2122/head
Daniel Gibbs 6 years ago
committed by GitHub
parent
commit
cfbc460667
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 4
      .github/ISSUE_TEMPLATE/new-server-request.md
  3. 4
      lgsm/functions/check_config.sh
  4. 2
      lgsm/functions/check_deps.sh
  5. 2
      lgsm/functions/check_ip.sh
  6. 2
      lgsm/functions/check_logs.sh
  7. 4
      lgsm/functions/command_console.sh
  8. 2
      lgsm/functions/command_details.sh
  9. 4
      lgsm/functions/command_dev_clear_functions.sh
  10. 2
      lgsm/functions/command_dev_query_raw.sh
  11. 10
      lgsm/functions/command_fastdl.sh
  12. 12
      lgsm/functions/command_install.sh
  13. 8
      lgsm/functions/command_monitor.sh
  14. 2
      lgsm/functions/command_postdetails.sh
  15. 2
      lgsm/functions/command_start.sh
  16. 20
      lgsm/functions/command_stop.sh
  17. 12
      lgsm/functions/command_update.sh
  18. 8
      lgsm/functions/command_validate.sh
  19. 4
      lgsm/functions/command_wipe.sh
  20. 20
      lgsm/functions/core_getopt.sh
  21. 28
      lgsm/functions/fix.sh
  22. 6
      lgsm/functions/fix_steamcmd.sh
  23. 70
      lgsm/functions/info_config.sh
  24. 22
      lgsm/functions/info_parms.sh
  25. 2
      lgsm/functions/mods_core.sh
  26. 4
      lgsm/functions/update_ts3.sh

2
.github/ISSUE_TEMPLATE/bug_report.md

@ -43,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.

4
.github/ISSUE_TEMPLATE/new-server-request.md

@ -10,7 +10,7 @@ about: Suggest a new game server to be added
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.

4
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

2
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

2
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

2
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

4
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."

2
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

4
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

2
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

10
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=$?

12
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

8
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

2
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

2
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

20
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

12
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

8
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

4
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

20
lgsm/functions/core_getopt.sh

@ -61,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
@ -78,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
@ -90,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[@]}" )
@ -110,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

28
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."

6
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"

70
lgsm/functions/info_config.sh

@ -1112,106 +1112,106 @@ 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
# 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
@ -1220,19 +1220,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

22
lgsm/functions/info_parms.sh

@ -154,46 +154,46 @@ 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
fn_info_parms_risingworld
# 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

2
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"

4
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"

Loading…
Cancel
Save