From a05420bf105f5248357cc1ab042915cf5b455501 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 22 Oct 2016 16:10:41 -0400 Subject: [PATCH 001/102] adding Project Cars --- ProjectCars/pcserver | 155 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100755 ProjectCars/pcserver diff --git a/ProjectCars/pcserver b/ProjectCars/pcserver new file mode 100755 index 000000000..312b3cf32 --- /dev/null +++ b/ProjectCars/pcserver @@ -0,0 +1,155 @@ +#!/bin/bash +# Project Cars +# Server Management Script +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="211016" + +#### Variables #### + +# Notification Alerts +# (on|off) + +# Email +emailalert="off" +email="email@example.com" +#emailfrom="email@example.com" + +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + +# Steam login +steamuser="anonymous" +steampass="" + +# Start Variables + +fn_parms(){ +params=" --config ${servercfg}" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="projectcars" + +# Steam +appid="332670" + +# Steam App Branch Select +# Allows to opt into the various Steam app branches. Default branch is "". +# Example: "-beta beta" +branch="" + +# Server Details +servicename="projectcars-server" +gamename="Project Cars" +#engine="source" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}" +executabledir="${filesdir}" +executable="./DedicatedServerCmd" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${systemdir}/logs" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" +consolelogging="on" + +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" + +##### Script ##### +# Do not edit + +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir -p "${filedir}" + fi + echo -e " fetching ${filename}...\c" + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit 1 + fi + chmod +x "${filedir}/${filename}" +fi +source "${filedir}/${filename}" +} + +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_functions.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_dl.sh +core_functions.sh + +getopt=$1 +core_getopt.sh From 93343ac2088af31b0125f0356afb214661812a68 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 22 Oct 2016 16:20:28 -0400 Subject: [PATCH 002/102] fix --- ProjectCars/pcserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectCars/pcserver b/ProjectCars/pcserver index 312b3cf32..fe583240f 100755 --- a/ProjectCars/pcserver +++ b/ProjectCars/pcserver @@ -33,7 +33,7 @@ steampass="" # Start Variables fn_parms(){ -params=" --config ${servercfg}" +parms=" --config ${servercfg}" } #### Advanced Variables #### From 74677362066cc1aafb78fb62cd008de9e0746d61 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 22 Oct 2016 16:24:17 -0400 Subject: [PATCH 003/102] updates --- ProjectCars/pcserver | 1 - lgsm/functions/info_glibc.sh | 3 +++ lgsm/functions/install_config.sh | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ProjectCars/pcserver b/ProjectCars/pcserver index fe583240f..e2564fd6f 100755 --- a/ProjectCars/pcserver +++ b/ProjectCars/pcserver @@ -56,7 +56,6 @@ branch="" # Server Details servicename="projectcars-server" gamename="Project Cars" -#engine="source" # Directories rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index f7f333d63..a477f95f8 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -41,6 +41,9 @@ elif [ "${gamename}" == "Mumble" ]; then elif [ "${gamename}" == "No More Room in Hell" ]; then glibcrequired="2.15" glibcfix="yes" +elif [ "${gamename}" == "Project Cars" ]; then + glibcrequired="2.1" + glibcfix="no" elif [ "${gamename}" == "Quake 2" ]; then glibcrequired="2.0" glibcfix="no" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 43d0a0000..4193fcf55 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -291,6 +291,12 @@ elif [ "${gamename}" == "Project Zomboid" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars +elif [ "${gamename}" == "Project Cars" ]; then + gamedirname="ProjectCars" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${gamename}" == "Quake 2" ]; then gamedirname="Quake2" array_configs+=( server.cfg ) From f4759a337e4c6da86b9e6da9a976db2b2e9f4413 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Feb 2017 18:00:42 +0000 Subject: [PATCH 004/102] bb2server is an anonymous login --- BrainBread2/bb2server | 5 ----- 1 file changed, 5 deletions(-) diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index 0f5cb40d2..e01b9dbb8 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -20,11 +20,6 @@ version="170219" ######## Settings ######## ########################## -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -# Steam login -steamuser="username" -steampass='password' - ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters defaultmap="bba_barracks" maxplayers="20" From 6f085b28c376d1edb028aede2603ec8d8419f116 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 02:58:15 +0100 Subject: [PATCH 005/102] Global source engine FastDL & remove non bz2 files Fixes #1322 and #721 --- lgsm/functions/command_fastdl.sh | 159 +++++++++++++++++++++++++------ 1 file changed, 129 insertions(+), 30 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 9fe7ca68b..28e4b53f5 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -6,11 +6,18 @@ # Description: Creates a FastDL directory. local commandname="FASTDL" -local commandaction="FastDL" +local commandaction="FastDL Generator" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh +# Only Source supports FastDL +if [ "${engine}" != "source" ]; then + fn_print_error "${gamename} does not support FastDL" + fn_script_log_error "${gamename} does not support FastDL" + core_exit.sh +fi + # Directories webdir="${rootdir}/public_html" fastdldir="${webdir}/fastdl" @@ -24,25 +31,27 @@ fn_check_bzip2(){ # Returns true if not installed if [ -z "$(command -v bzip2)" ]; then bzip2installed="0" - fn_print_info "bzip2 is not installed !" - fn_script_log_info "bzip2 is not installed" + fn_print_info "bzip2 is not installed! Install it to enable file compression" + fn_script_log_info "bzip2 is not installed. Install it to enable file compression." + fn_script_log_info "https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" echo -en "\n" sleep 1 - echo "We advise using it" - echo "For more information, see https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" + echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" sleep 2 + echo "" else bzip2installed="1" fi } fn_fastdl_init(){ - # User confirmation - fn_print_ok "Welcome to LGSM's FastDL generator" + fn_print_header + fn_script_log "Started FastDL Generator" sleep 1 echo -en "\n" - fn_script_log "Started FastDL creation" - if ! fn_prompt_yn "Continue?" Y; then + fn_check_bzip2 + # User confirmation + if ! fn_prompt_yn "Build FastDL directory?" Y; then exit fi fn_script_log "Initiating FastDL creation" @@ -105,7 +114,7 @@ fn_fastdl_config(){ fi } -fn_fastdl_gmod_config(){ +fn_fastdl_gmod_luaenforcer(){ # Prompt for download enforcer, that is using a .lua addfile resource generator fn_print_dots if fn_prompt_yn "Use client download enforcer?" Y; then @@ -130,7 +139,7 @@ fn_clear_old_fastdl(){ fi } -fn_gmod_fastdl(){ +fn_fastdl_gmod(){ # Copy all needed files for FastDL echo "" fn_print_dots "Starting gathering all needed files" @@ -213,7 +222,7 @@ fn_gmod_fastdl(){ fn_script_log "Adjusting addon's file structure" sleep 1 cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" - #Don't remove yet rm -R "${fastdldir:?}/addons" + # Don't remove yet rm -R "${fastdldir:?}/addons" fn_print_ok "Adjusted addon's file structure" sleep 1 echo -en "\n" @@ -221,7 +230,7 @@ fn_gmod_fastdl(){ # Correct content that may be into a lua directory by mistake like some darkrpmodification addons if [ -d "${fastdldir}/lua" ]; then - fn_print_dots "Typical DarkRP shit detected, fixing" + fn_print_dots "Typical DarkRP files detected, fixing" sleep 2 cp -Rf "${fastdldir}/lua/"* "${fastdldir}" fn_print_ok "Stupid DarkRP file structure fixed" @@ -230,8 +239,80 @@ fn_gmod_fastdl(){ fi } +fn_fastdl_source(){ + # Copy all needed files for FastDL + echo "" + fn_print_dots "Starting gathering all needed files" + fn_script_log "Starting gathering all needed files" + sleep 1 + echo -en "\n" + + # Map Files + fn_print_dots "Copying map files..." + fn_script_log "Copying map files" + sleep 0.5 + mkdir "${fastdldir}/maps" + find "${systemdir}/maps" -name '*.bsp' -exec cp {} "${fastdldir}/maps" \; + find "${systemdir}/maps" -name '*.ain' -exec cp {} "${fastdldir}/maps" \; + find "${systemdir}/maps" -name '*.nav' -exec cp {} "${fastdldir}/maps" \; + find "${systemdir}/maps" -name '*.jpg' -exec cp {} "${fastdldir}/maps" \; + find "${systemdir}/maps" -name '*.txt' -exec cp {} "${fastdldir}/maps" \; + fn_print_ok "Map files copied" + sleep 0.5 + echo -en "\n" + + # Materials + fn_print_dots "Copying materials..." + fn_script_log "Copying materials" + sleep 0.5 + mkdir "${fastdldir}/materials" + find "${systemdir}/materials" -name '*.vtf' -exec cp {} "${fastdldir}/materials" \; + find "${systemdir}/materials" -name '*.vmt' -exec cp {} "${fastdldir}/materials" \; + find "${systemdir}/materials" -name '*.vbf' -exec cp {} "${fastdldir}/materials" \; + fn_print_ok "Materials copied" + sleep 0.5 + echo -en "\n" + + # Models + fn_print_dots "Copying models..." + fn_script_log "Copying models" + sleep 1 + mkdir "${fastdldir}/models" + find "${systemdir}/models" -name '*.vtx' -exec cp {} "${fastdldir}/models" \; + find "${systemdir}/models" -name '*.vvd' -exec cp {} "${fastdldir}/models" \; + find "${systemdir}/models" -name '*.mdl' -exec cp {} "${fastdldir}/models" \; + find "${systemdir}/models" -name '*.phy' -exec cp {} "${fastdldir}/models" \; + find "${systemdir}/models" -name '*.jpg' -exec cp {} "${fastdldir}/models" \; + find "${systemdir}/models" -name '*.png' -exec cp {} "${fastdldir}/models" \; + fn_print_ok "Models copied" + sleep 0.5 + echo -en "\n" + + # Particles + fn_print_dots "Copying particles..." + fn_script_log "Copying particles" + sleep 0.5 + mkdir "${fastdldir}/particles" + find "${systemdir}" -name '*.pcf' -exec cp {} "${fastdldir}/particles" \; + fn_print_ok "Particles copied" + sleep 0.5 + echo -en "\n" + + # Sounds + fn_print_dots "Copying sounds..." + fn_script_log "Copying sounds" + sleep 0.5 + mkdir "${fastdldir}/sound" + find "${systemdir}" -name '*.wav' -exec cp {} "${fastdldir}/sound" \; + find "${systemdir}" -name '*.mp3' -exec cp {} "${fastdldir}/sound" \; + find "${systemdir}" -name '*.ogg' -exec cp {} "${fastdldir}/sound" \; + fn_print_ok "Sounds copied" + sleep 0.5 + echo -en "\n" +} + # Generate lua file that will force download any file into the FastDL directory -fn_lua_fastdl(){ +fn_fastdl_gmod_lua(){ # Remove lua file if luaressource is turned off and file exists echo "" if [ "${luaressource}" == "off" ]; then @@ -286,36 +367,54 @@ fn_fastdl_bzip2(){ fn_script_log "bzip2 compression done" sleep 1 echo -en "\n" + # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod + fn_print_dots + if [ "${gamename}" == "Garry's Mod" ]; then + if fn_prompt_yn "Keep original/uncompressed FastDL files?" N; then + fn_print_info "Keeping uncompressed FastDL files"; fn_script_log fn_print_info "Keeping uncompressed FastDL files" + else + find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \; fn_print_dots "Clearing uncompressed FastDL files..."; sleep 1; fn_print_ok "Cleared uncompressed FastDL files"; fn_script_log "Cleared uncompressed FastDL files." + fi + echo -en "\n" + else + fn_print_dots "Clearing uncompressed FastDL files..." + sleep 1 + find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \ + fn_print_ok "Cleared uncompressed FastDL files." + fn_script_log "Cleared uncompressed FastDL files." + fi fi } fn_fastdl_completed(){ # Finished message echo "" - fn_print_ok "Congratulations, it's done!" + fn_print_ok "FastDL created!" fn_script_log "FastDL job done" sleep 2 echo -en "\n" echo "" - fn_print_info "Need more documentation? See https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" + fn_print_info_nl "Need more documentation? + echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" echo -en "\n" if [ "$bzip2installed" == "0" ]; then - echo "By the way, you'd better install bzip2 and re-run this command!" + echo "By the way, you'd better install bzip2 and re-run this command!" fi - echo "Credits : UltimateByte" + echo "Credits: UltimateByte" } -# Game checking and functions running -# Garry's Mod +# Run functions +fn_check_bzip2 +fn_fastdl_init +fn_fastdl_config +fn_clear_old_fastdl if [ "${gamename}" == "Garry's Mod" ]; then - fn_check_bzip2 - fn_fastdl_init - fn_fastdl_config - fn_fastdl_gmod_config - fn_clear_old_fastdl - fn_gmod_fastdl - fn_lua_fastdl - fn_fastdl_bzip2 - fn_fastdl_completed - exit + fn_fastdl_gmod_luaenforcer + fn_fastdl_gmod + fn_fastdl_gmod_lua +else + fn_fastdl_source fi +fn_fastdl_bzip2 +fn_fastdl_completed +core_exit.sh From 2ac7d096a3176a7a4d52fdc790513c37e01ad5bd Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 03:02:12 +0100 Subject: [PATCH 006/102] added fastdl #721 Added to fn_getopt_generic for now, will need to remove from non-source games when core_getopt.sh rework comes out. --- lgsm/functions/core_getopt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index bcecc6c2d..1d91f9bc8 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -43,6 +43,8 @@ case "${getopt}" in command_install.sh;; ai|auto-install) fn_autoinstall;; + fd|fastdl) + command_fastdl.sh;; mi|mods-install) command_mods_install.sh;; mu|mods-update) @@ -82,6 +84,7 @@ case "${getopt}" in echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." echo -e "${blue}install\t${default}i |Install the server." echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}fastdl\t${default}fd |Generates or update a FastDL directory for your server." echo -e "${blue}mods-install\t${default}mi |View and install available mods/addons." echo -e "${blue}mods-update\t${default}mu |Update installed mods/addons." echo -e "${blue}mods-remove\t${default}mr |Remove installed mods/addons." From cdba3114a24e63e599dac9487bc30b83f0c4938a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 03:05:52 +0100 Subject: [PATCH 007/102] woops double quote --- lgsm/functions/command_fastdl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 28e4b53f5..4b7584079 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -394,7 +394,7 @@ fn_fastdl_completed(){ sleep 2 echo -en "\n" echo "" - fn_print_info_nl "Need more documentation? + fn_print_info_nl "Need more documentation?" echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" echo -en "\n" if [ "$bzip2installed" == "0" ]; then From 3a4266b9f149daa27465e3ee5feb248bd37f0c09 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 03:16:16 +0100 Subject: [PATCH 008/102] missing ";", attempt for fix --- lgsm/functions/command_fastdl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 4b7584079..0f7c034cd 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -373,13 +373,13 @@ fn_fastdl_bzip2(){ if fn_prompt_yn "Keep original/uncompressed FastDL files?" N; then fn_print_info "Keeping uncompressed FastDL files"; fn_script_log fn_print_info "Keeping uncompressed FastDL files" else - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \; fn_print_dots "Clearing uncompressed FastDL files..."; sleep 1; fn_print_ok "Cleared uncompressed FastDL files"; fn_script_log "Cleared uncompressed FastDL files." + find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \;;fn_print_dots "Clearing uncompressed FastDL files..."; sleep 1; fn_print_ok "Cleared uncompressed FastDL files"; fn_script_log "Cleared uncompressed FastDL files." fi echo -en "\n" else fn_print_dots "Clearing uncompressed FastDL files..." sleep 1 - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \ + find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \; fn_print_ok "Cleared uncompressed FastDL files." fn_script_log "Cleared uncompressed FastDL files." fi From c9329a02fab2f0b3e38d1b85b1892eb366384697 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 03:20:38 +0100 Subject: [PATCH 009/102] no dots in user messages --- lgsm/functions/command_fastdl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 0f7c034cd..edac9e494 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -380,7 +380,7 @@ fn_fastdl_bzip2(){ fn_print_dots "Clearing uncompressed FastDL files..." sleep 1 find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \; - fn_print_ok "Cleared uncompressed FastDL files." + fn_print_ok "Cleared uncompressed FastDL files" fn_script_log "Cleared uncompressed FastDL files." fi fi From 7693392c5823774014ebbd3f63ada749ef652cd5 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 03:25:35 +0100 Subject: [PATCH 010/102] addons' --- lgsm/functions/command_fastdl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index edac9e494..ac16d5e64 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -219,11 +219,11 @@ fn_fastdl_gmod(){ # Correct addons directory structure for FastDL if [ -d "${fastdldir}/addons" ]; then fn_print_info "Adjusting addons' file structure" - fn_script_log "Adjusting addon's file structure" + fn_script_log "Adjusting addons' file structure" sleep 1 cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" # Don't remove yet rm -R "${fastdldir:?}/addons" - fn_print_ok "Adjusted addon's file structure" + fn_print_ok "Adjusted addons' file structure" sleep 1 echo -en "\n" fi From b4da7c532bbc234db9d236a280910f03f3fda11e Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 04:20:12 +0100 Subject: [PATCH 011/102] various improvements to code logic --- lgsm/functions/command_fastdl.sh | 82 ++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index ac16d5e64..1659a0a21 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -44,11 +44,11 @@ fn_check_bzip2(){ fi } +# Initiates FastDL fn_fastdl_init(){ fn_print_header fn_script_log "Started FastDL Generator" sleep 1 - echo -en "\n" fn_check_bzip2 # User confirmation if ! fn_prompt_yn "Build FastDL directory?" Y; then @@ -72,28 +72,30 @@ fn_fastdl_init(){ fi if [ ! -d "${fastdldir}" ]; then # No directory, won't ask for removing old ones - newfastdl=1 + newfastdl="true" fn_print_dots "Creating fastdl directory" sleep 0.5 mkdir "${fastdldir}" fn_print_ok "Created fastdl directory" - fn_script_log "FastDL created fastdl directory" + fn_script_log "Created fastdl directory" sleep 1 echo -en "\n" clearoldfastdl="off" # Nothing to clear elif [ "$(ls -A "${fastdldir}")" ]; then - newfastdl=0 + newfastdl="false" + else + newfastdl="true" fi } +# Prompts user for FastDL creation settings fn_fastdl_config(){ - # Global settings for FastDL creation fn_print_info "Entering configuration" fn_script_log "Configuration" sleep 2 echo -en "\n" # Prompt for clearing old files if directory was already here - if [ -n "${newfastdl}" ] && [ "${newfastdl}" == "0" ]; then + if [ "${newfastdl}" == "false" ]; then fn_print_dots if fn_prompt_yn "Clear old FastDL files?" Y; then clearoldfastdl="on"; fn_script_log "clearoldfastdl enabled"; fn_print_ok "Clearing Enabled" @@ -102,27 +104,42 @@ fn_fastdl_config(){ fi echo -en "\n" fi - # Prompt for using bzip2 if it's installed + # Settings for bzip2 users if [ ${bzip2installed} == 1 ]; then + # Prompt for using bzip2 if it's installed fn_print_dots - if fn_prompt_yn "Enable file compression using bzip2?" Y; then + if fn_prompt_yn "Enable bzip2 file compression?" Y; then bzip2enable="on"; fn_script_log "bzip2 enabled"; fn_print_ok "bzip2 Enabled" else bzip2enable="off"; fn_script_log "bzip2 disabled"; fn_print_ok "bzip2 Disabled" fi echo -en "\n" + if [ "${gamename}" == "Garry's Mod" ]&&[ "${bzip2enable}" == "on" ]; then + # Prompt for removing uncompressed FastDL files + fn_print_dots + if fn_prompt_yn "Keep original uncompressed FastDL files?" N; then + clearnonbzip2="on"; fn_script_log "Original uncompressed fastDL files won't be kept."; fn_print_ok "Original uncompressed fastDL files won't be kept" + else + clearnonbzip2="off"; fn_script_log "Original uncompressed fastDL files will be kept."; fn_print_ok "Original uncompressed fastDL files will be kept" + fi + echo -en "\n" + else + # Other games default remove non bzip2 files + clearnonbzip2="on" + fn_script_log "Original uncompressed fastDL files won't be kept." + fi fi -} - -fn_fastdl_gmod_luaenforcer(){ - # Prompt for download enforcer, that is using a .lua addfile resource generator - fn_print_dots - if fn_prompt_yn "Use client download enforcer?" Y; then - luaressource="on"; fn_script_log "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled" - else - luaressource="off"; fn_script_log "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled" + # Garry's Mod Specific + if [ "${gamename}" == "Garry's Mod" ]; then + # Prompt for download enforcer, which is using a .lua addfile resource generator + fn_print_dots + if fn_prompt_yn "Use client download enforcer?" Y; then + luaressource="on"; fn_script_log "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled" + else + luaressource="off"; fn_script_log "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled" + fi + echo -en "\n" fi - echo -en "\n" } fn_clear_old_fastdl(){ @@ -148,8 +165,8 @@ fn_fastdl_gmod(){ echo -en "\n" # No choice to cd to the directory, as find can't then display relative directory - cd "${systemdir}" - + cd "${systemdir}" || exit + # Map Files fn_print_dots "Copying map files..." fn_script_log "Copying map files" @@ -312,7 +329,7 @@ fn_fastdl_source(){ } # Generate lua file that will force download any file into the FastDL directory -fn_fastdl_gmod_lua(){ +fn_fastdl_gmod_lua_enforcer(){ # Remove lua file if luaressource is turned off and file exists echo "" if [ "${luaressource}" == "off" ]; then @@ -341,8 +358,8 @@ fn_fastdl_gmod_lua(){ fn_script_log "Generating new download enforcer" sleep 1 # Read all filenames and put them into a lua file at the right path - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do - echo "resource.AddFile( "\""${line}"\"" )" >> ${luafastdlfullpath} + find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do + echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}" done fn_print_ok "Download enforcer generated" fn_script_log "Download enforcer generated" @@ -362,24 +379,18 @@ fn_fastdl_bzip2(){ fn_print_dots "Compressing files using bzip2..." fn_script_log "Compressing files using bzip2..." # bzip2 all files that are not already compressed (keeping original files) - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; + find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; fn_print_ok "bzip2 compression done" fn_script_log "bzip2 compression done" sleep 1 echo -en "\n" # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod fn_print_dots - if [ "${gamename}" == "Garry's Mod" ]; then - if fn_prompt_yn "Keep original/uncompressed FastDL files?" N; then - fn_print_info "Keeping uncompressed FastDL files"; fn_script_log fn_print_info "Keeping uncompressed FastDL files" - else - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \;;fn_print_dots "Clearing uncompressed FastDL files..."; sleep 1; fn_print_ok "Cleared uncompressed FastDL files"; fn_script_log "Cleared uncompressed FastDL files." - fi - echo -en "\n" - else - fn_print_dots "Clearing uncompressed FastDL files..." + # Clear non compressed FastDL files + if [ "${clearnonbzip2}" == "on" ]; then + fn_print_dots "Clearing original uncompressed FastDL files..." sleep 1 - find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec rm {} \; + find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -exec rm {} \; fn_print_ok "Cleared uncompressed FastDL files" fn_script_log "Cleared uncompressed FastDL files." fi @@ -409,9 +420,8 @@ fn_fastdl_init fn_fastdl_config fn_clear_old_fastdl if [ "${gamename}" == "Garry's Mod" ]; then - fn_fastdl_gmod_luaenforcer fn_fastdl_gmod - fn_fastdl_gmod_lua + fn_fastdl_gmod_lua_enforcer else fn_fastdl_source fi From b94bb9a29352412e3bc2357f9628e7ee2ee23705 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 04:30:07 +0100 Subject: [PATCH 012/102] useless print_dots --- lgsm/functions/command_fastdl.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 1659a0a21..a79aeb5e9 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -115,7 +115,7 @@ fn_fastdl_config(){ fi echo -en "\n" if [ "${gamename}" == "Garry's Mod" ]&&[ "${bzip2enable}" == "on" ]; then - # Prompt for removing uncompressed FastDL files + # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod fn_print_dots if fn_prompt_yn "Keep original uncompressed FastDL files?" N; then clearnonbzip2="on"; fn_script_log "Original uncompressed fastDL files won't be kept."; fn_print_ok "Original uncompressed fastDL files won't be kept" @@ -384,8 +384,6 @@ fn_fastdl_bzip2(){ fn_script_log "bzip2 compression done" sleep 1 echo -en "\n" - # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod - fn_print_dots # Clear non compressed FastDL files if [ "${clearnonbzip2}" == "on" ]; then fn_print_dots "Clearing original uncompressed FastDL files..." From c517b4624bc7a1190609d4423b03c74f6f63acf9 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 04:40:15 +0100 Subject: [PATCH 013/102] Inverted gmod clearnonbzip2 --- lgsm/functions/command_fastdl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index a79aeb5e9..2c12ded38 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -118,9 +118,9 @@ fn_fastdl_config(){ # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod fn_print_dots if fn_prompt_yn "Keep original uncompressed FastDL files?" N; then - clearnonbzip2="on"; fn_script_log "Original uncompressed fastDL files won't be kept."; fn_print_ok "Original uncompressed fastDL files won't be kept" - else clearnonbzip2="off"; fn_script_log "Original uncompressed fastDL files will be kept."; fn_print_ok "Original uncompressed fastDL files will be kept" + else + clearnonbzip2="on"; fn_script_log "Original uncompressed fastDL files won't be kept."; fn_print_ok "Original uncompressed fastDL files won't be kept" fi echo -en "\n" else From 828a9831b5a765c107c6a3ab1e7c3238bc485df7 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 05:55:29 +0100 Subject: [PATCH 014/102] chivalry init --- ChivalryMedievalWarfare/chivalrymwserver | 199 +++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 ChivalryMedievalWarfare/chivalrymwserver diff --git a/ChivalryMedievalWarfare/chivalrymwserver b/ChivalryMedievalWarfare/chivalrymwserver new file mode 100644 index 000000000..2f4179304 --- /dev/null +++ b/ChivalryMedievalWarfare/chivalrymwserver @@ -0,0 +1,199 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2017 Daniel Gibbs +# Purpose: Chivalry: Medieval Warfare | Server Management Script +# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors +# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki +# Website: https://gameservermanagers.com + +# Debugging +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="170219" + +########################## +######## Settings ######## +########################## + +#### Server Settings #### + +## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters +ip="0.0.0.0" +port=7000" +queryport="7010" +adminpassword="CHANGE_ME" + +## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters +fn_parms(){ +parms="aocffa-moor_p\?steamsockets\?adminpassword=${adminpassword}\?port=${port}\?queryport=${queryport} -seekfreeloadingserver" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) +# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update +updateonstart="off" + +## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging +consolelogging="on" +logdays="7" + +#### LinuxGSM Advanced Settings #### + +## SteamCMD Settings +# Server appid +appid="220070" +# Steam App Branch Select +# Allows to opt into the various Steam app branches. Default branch is "". +# Example: "-beta latest_experimental" +branch="" + +## Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + +## LinuxGSM Server Details +# Do not edit +gamename="Chivalry: Medieval Warfare" +engine="unreal3" + +## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers +servicename="chivalrymw-server" + +#### Directories #### +# Edit with care + +## Work Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +filesdir="${rootdir}/serverfiles" + +## Server Specific Directories +systemdir="${filesdir}" +executabledir="${filesdir}" +executable="./UDKGameServer-Linux" +servercfg="unknown" +servercfgdefault="unknown" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +gamelogdir="${rootdir}/log/server" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" +gamelog="${gamelogdir}/${servicename}-game.log" +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +## Logs Naming +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +######################## +######## Script ######## +###### Do not edit ##### +######################## + +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir -p "${filedir}" + fi + echo -e " fetching ${filename}...\c" + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit 1 + fi + chmod +x "${filedir}/${filename}" +fi +source "${filedir}/${filename}" +} + +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_functions.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +# Prevent from running this script as root. +if [ "$(whoami)" = "root" ]; then + if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then + echo "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +core_dl.sh +core_functions.sh +getopt=$1 +core_getopt.sh From 51542d311f7d6378dbb8ae7713fb0bf3ffd3c5fa Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 05:56:39 +0100 Subject: [PATCH 015/102] double quote --- ChivalryMedievalWarfare/chivalrymwserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChivalryMedievalWarfare/chivalrymwserver b/ChivalryMedievalWarfare/chivalrymwserver index 2f4179304..0192710fd 100644 --- a/ChivalryMedievalWarfare/chivalrymwserver +++ b/ChivalryMedievalWarfare/chivalrymwserver @@ -24,7 +24,7 @@ version="170219" ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters ip="0.0.0.0" -port=7000" +port="7000" queryport="7010" adminpassword="CHANGE_ME" From 8f0e4c07a0e04318c5af26733db57b83e0fc1f10 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 06:05:11 +0100 Subject: [PATCH 016/102] execdir --- ChivalryMedievalWarfare/chivalrymwserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChivalryMedievalWarfare/chivalrymwserver b/ChivalryMedievalWarfare/chivalrymwserver index 0192710fd..ad1a83d94 100644 --- a/ChivalryMedievalWarfare/chivalrymwserver +++ b/ChivalryMedievalWarfare/chivalrymwserver @@ -99,7 +99,7 @@ filesdir="${rootdir}/serverfiles" ## Server Specific Directories systemdir="${filesdir}" -executabledir="${filesdir}" +executabledir="${filesdir}/Binaries/Linux/" executable="./UDKGameServer-Linux" servercfg="unknown" servercfgdefault="unknown" From 5f53f4c22b12e37bc42774ada7088c0adec75670 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 06:19:43 +0100 Subject: [PATCH 017/102] cfg files --- ChivalryMedievalWarfare/chivalrymwserver | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChivalryMedievalWarfare/chivalrymwserver b/ChivalryMedievalWarfare/chivalrymwserver index ad1a83d94..6315fc2e3 100644 --- a/ChivalryMedievalWarfare/chivalrymwserver +++ b/ChivalryMedievalWarfare/chivalrymwserver @@ -101,9 +101,9 @@ filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}/Binaries/Linux/" executable="./UDKGameServer-Linux" -servercfg="unknown" -servercfgdefault="unknown" -servercfgdir="${systemdir}" +servercfg="PCServer-UDKGame.ini" +servercfgdefault="PCServer-UDKGame.ini" +servercfgdir="${systemdir}/UDKGame/Config" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory From a2a21a1e73e2b6125e08cf84ef2ae752ef8aa516 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 06:27:22 +0100 Subject: [PATCH 018/102] gamelog & multihome --- ChivalryMedievalWarfare/chivalrymwserver | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChivalryMedievalWarfare/chivalrymwserver b/ChivalryMedievalWarfare/chivalrymwserver index 6315fc2e3..fab972b91 100644 --- a/ChivalryMedievalWarfare/chivalrymwserver +++ b/ChivalryMedievalWarfare/chivalrymwserver @@ -30,7 +30,7 @@ adminpassword="CHANGE_ME" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters fn_parms(){ -parms="aocffa-moor_p\?steamsockets\?adminpassword=${adminpassword}\?port=${port}\?queryport=${queryport} -seekfreeloadingserver" +parms="aocffa-moor_p\?steamsockets\?adminpassword=${adminpassword}\?port=${port}\?queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog} -seekfreeloadingserver" } #### LinuxGSM Settings #### @@ -121,6 +121,7 @@ emaillog="${scriptlogdir}/${servicename}-email.log" ## Logs Naming scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" ######################## ######## Script ######## From ec30a155cef3f6e1d695c94654dc2f0095e74823 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 06:41:47 +0100 Subject: [PATCH 019/102] New default ports & password through cfg file --- ChivalryMedievalWarfare/chivalrymwserver | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ChivalryMedievalWarfare/chivalrymwserver b/ChivalryMedievalWarfare/chivalrymwserver index fab972b91..6fd0d8ff0 100644 --- a/ChivalryMedievalWarfare/chivalrymwserver +++ b/ChivalryMedievalWarfare/chivalrymwserver @@ -24,13 +24,12 @@ version="170219" ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters ip="0.0.0.0" -port="7000" -queryport="7010" -adminpassword="CHANGE_ME" +port="7777" +queryport="27960" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters fn_parms(){ -parms="aocffa-moor_p\?steamsockets\?adminpassword=${adminpassword}\?port=${port}\?queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog} -seekfreeloadingserver" +parms="aocffa-moor_p\?steamsockets\?port=${port}\?queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog} -seekfreeloadingserver" } #### LinuxGSM Settings #### From ac0390719f940ba989fb9a5af7ae1986cd611fdf Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 19:17:57 +0100 Subject: [PATCH 020/102] fit changes to master --- lgsm/functions/install_logs.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index 2019fdb13..3feb0feea 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -14,7 +14,7 @@ if [ "${checklogs}" != "1" ]; then echo "=================================" fi sleep 1 -# Create dir's for the script and console logs +# Create script and console log directories mkdir -v "${rootdir}/log" mkdir -v "${scriptlogdir}" touch "${scriptlog}" @@ -23,23 +23,23 @@ if [ -n "${consolelogdir}" ]; then touch "${consolelog}" fi -# If a server is source or goldsource, TeamSpeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs. -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]||[ "${engine}" == "unreal" ]; then +# Create gamelogdir if variable exists but directory does not +if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then + mkdir -pv "${gamelogdir}" +fi + +# Symlink gamelogdir to lgsm logs if variable exists +if [ -n "${gamelogdir}" ]; then if [ ! -h "${rootdir}/log/server" ]; then ln -nfsv "${gamelogdir}" "${rootdir}/log/server" fi fi -# If a server is unreal2 or unity3d create a dir. -if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Teeworlds" ]||[ "${gamename}" == "seriousengine35" ]; then - mkdir -pv "${gamelogdir}" -fi - -# If server uses SteamCMD create a symbolic link to the Steam logs. +# If server uses SteamCMD create a symbolic link to the Steam logs if [ -d "${rootdir}/Steam/logs" ]; then if [ ! -h "${rootdir}/log/steamcmd" ]; then ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd" fi fi sleep 1 -fn_script_log_info "Logs installed" \ No newline at end of file +fn_script_log_info "Logs installed" From 0c94a78f908228984f3448ee68feb776fea7850c Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 19:18:23 +0100 Subject: [PATCH 021/102] Fit changes to master --- lgsm/functions/command_console.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 98ddcae11..0a93a94fb 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -16,7 +16,6 @@ echo "" if ! fn_prompt_yn "Continue?" Y; then echo Exiting; return fi -done fn_print_dots "Accessing console" sleep 1 check_status.sh From 418fb6b9ea19870e03737b901a32b6228c2e0e19 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 19:55:21 +0100 Subject: [PATCH 022/102] allow addons clear + more logic output --- lgsm/functions/command_fastdl.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 2c12ded38..8a02f90a4 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -117,10 +117,10 @@ fn_fastdl_config(){ if [ "${gamename}" == "Garry's Mod" ]&&[ "${bzip2enable}" == "on" ]; then # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod fn_print_dots - if fn_prompt_yn "Keep original uncompressed FastDL files?" N; then - clearnonbzip2="off"; fn_script_log "Original uncompressed fastDL files will be kept."; fn_print_ok "Original uncompressed fastDL files will be kept" + if fn_prompt_yn "Clear non-bzip2 FastDL files?" Y; then + clearnonbzip2="on"; fn_script_log "Clearing non-bzip2 files Enabled."; fn_print_ok "Clearing non-bzip2 files Enabled" else - clearnonbzip2="on"; fn_script_log "Original uncompressed fastDL files won't be kept."; fn_print_ok "Original uncompressed fastDL files won't be kept" + clearnonbzip2="off"; fn_script_log "Clearing non-bzip2 files Disabled."; fn_print_ok "Clearing non-bzip2 files Disabled" fi echo -en "\n" else @@ -131,12 +131,18 @@ fn_fastdl_config(){ fi # Garry's Mod Specific if [ "${gamename}" == "Garry's Mod" ]; then + if fn_prompt_yn "Clear addons dir from fastdl dir?" Y; then + cleargmodaddons="on"; fn_script_log "Addons clearing Enabled."; fn_print_ok "Addons clearing Enabled" + else + cleargmodaddons="off"; fn_script_log "Addons clearing Disabled."; fn_print_ok "Addons clearing Disabled" + fi + echo -en "\n" # Prompt for download enforcer, which is using a .lua addfile resource generator fn_print_dots if fn_prompt_yn "Use client download enforcer?" Y; then - luaressource="on"; fn_script_log "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled" + luaressource="on"; fn_script_log "DL enforcer Enabled."; fn_print_ok "Enforcer Enabled" else - luaressource="off"; fn_script_log "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled" + luaressource="off"; fn_script_log "DL enforcer Disabled."; fn_print_ok "Enforcer Disabled" fi echo -en "\n" fi @@ -239,10 +245,19 @@ fn_fastdl_gmod(){ fn_script_log "Adjusting addons' file structure" sleep 1 cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" - # Don't remove yet rm -R "${fastdldir:?}/addons" fn_print_ok "Adjusted addons' file structure" sleep 1 echo -en "\n" + # Clear addons directory in fastdl + if [ "${cleargmodaddons}" == "on" ]; then + fn_print_info "Clearing addons dir from fastdl dir" + fn_script_log "Clearing addons dir from fastdl dir" + sleep 1 + rm -R "${fastdldir:?}/addons" + fn_print_ok "Cleared addons dir from fastdl dir" + sleep 1 + echo -en "\n" + fi fi # Correct content that may be into a lua directory by mistake like some darkrpmodification addons From 184396a5ebc333218c0580f00cfdf0d66e14a9d2 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 19:58:59 +0100 Subject: [PATCH 023/102] print dots --- lgsm/functions/command_fastdl.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 8a02f90a4..5d20df759 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -131,6 +131,8 @@ fn_fastdl_config(){ fi # Garry's Mod Specific if [ "${gamename}" == "Garry's Mod" ]; then + # Prompt to clear addons dir from fastdl, can use unnecessary space or be required depending on addon's file structures + fn_print_dots if fn_prompt_yn "Clear addons dir from fastdl dir?" Y; then cleargmodaddons="on"; fn_script_log "Addons clearing Enabled."; fn_print_ok "Addons clearing Enabled" else From b00548f6bb259539a93def9140a41764b9bd86fe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 20 Feb 2017 19:54:44 +0000 Subject: [PATCH 024/102] Added auto instal to mumble server --- lgsm/functions/core_getopt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index bcecc6c2d..e738cab25 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -453,6 +453,8 @@ case "${getopt}" in command_console.sh;; i|install) command_install.sh;; + ai|auto-install) + fn_autoinstall;; dd|detect-deps) command_dev_detect_deps.sh;; dg|detect-glibc) @@ -482,6 +484,7 @@ case "${getopt}" in echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." } | column -s $'\t' -t esac } From 9d5097f9cd7ec243fcc9d8f2188e85a753a418c6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 20 Feb 2017 19:56:34 +0000 Subject: [PATCH 025/102] debug option was missing from mumbleserver --- lgsm/functions/core_getopt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index e738cab25..a63efc6cc 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -447,6 +447,8 @@ case "${getopt}" in command_postdetails.sh;; b|backup) command_backup.sh;; + d|debug) + command_debug.sh;; dev|dev-debug) command_dev_debug.sh;; c|console) From b3c615f333d4cc27029a0e41eab8481d8344a622 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 20 Feb 2017 21:01:04 +0000 Subject: [PATCH 026/102] Fixed IP for MTA server --- lgsm/functions/info_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 9ce3ba242..cb17e09d5 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -663,7 +663,7 @@ fn_info_config_mta(){ ase="Disabled" fi - ip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + ip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") ipsetinconfig=1 ipinconfigvar="serverip" From 73a44719ae7ce2c1709cca5f7e953dcfe2de9ae3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 20 Feb 2017 21:31:14 +0000 Subject: [PATCH 027/102] Added several more games to graceful shutdown --- lgsm/functions/command_stop.sh | 38 ++++++---------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 341ad4d95..bef3ddf26 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -231,9 +231,9 @@ fn_stop_graceful_mta(){ fn_stop_graceful_select(){ if [ "${gamename}" == "7 Days To Die" ]; then fn_stop_graceful_sdtd - elif [ "${gamename}" == "Factorio" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]; then + elif [ "${gamename}" == "Factorio" ]||[ "${gamename}" == "Minecraft" ]||[ "${gamename}" == "Multi Theft Auto" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]; then fn_stop_graceful_ctrlc - elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]; then + elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]; then fn_stop_graceful_quit elif [ "${engine}" == "goldsource" ]; then fn_stop_graceful_goldsource @@ -290,8 +290,8 @@ fn_stop_ark(){ fn_stop_teamspeak3(){ fn_print_dots "${servername}" - sleep 1 - ${filesdir}/ts3server_startscript.sh stop > /dev/null 2>&1 + sleep 0.5 + "${filesdir}"/ts3server_startscript.sh stop > /dev/null 2>&1 check_status.sh if [ "${status}" == "0" ]; then # Remove lockfile @@ -304,29 +304,10 @@ fn_stop_teamspeak3(){ fi } -fn_stop_mumble(){ - # Get needed port info - info_config.sh - fn_print_dots "Stopping ${servername}" - mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep "${port}" | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') - kill ${mumblepid} - sleep 1 - check_status.sh - if [ "${status}" == "0" ]; then - # Remove lockfile - rm -f "${rootdir}/${lockselfname}" - fn_stop_tmux - fn_script_log_pass "Stopped ${servername}" - else - fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_error "Unable to stop ${servername}" - fi -} - fn_stop_tmux(){ fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${servername}" - sleep 1 + sleep 0.5 # Kill tmux session tmux kill-session -t "${servicename}" > /dev/null 2>&1 sleep 0.5 @@ -357,13 +338,6 @@ fn_stop_pre_check(){ else fn_stop_teamspeak3 fi - elif [ "${gamename}" == "Mumble" ]; then - if [ "${status}" == "0" ]; then - fn_print_info_nl "${servername} is already stopped" - fn_script_log_error "${servername} is already stopped" - else - fn_stop_mumble - fi else if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" @@ -375,7 +349,7 @@ fn_stop_pre_check(){ } fn_print_dots "${servername}" -sleep 1 +sleep 0.5 check.sh info_config.sh fn_stop_pre_check From b6a708fcd97c54c5a6bb6c54e27002f0ae3b900a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 23:34:52 +0100 Subject: [PATCH 028/102] Attempt for new op --- lgsm/functions/core_getopt.sh | 1090 ++++----------------------------- 1 file changed, 128 insertions(+), 962 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 1d91f9bc8..f87b55a0e 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -6,980 +6,146 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -fn_getopt_generic(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - fd|fastdl) - command_fastdl.sh;; - mi|mods-install) - command_mods_install.sh;; - mu|mods-update) - command_mods_update.sh;; - mr|mods-remove) - command_mods_remove.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}fastdl\t${default}fd |Generates or update a FastDL directory for your server." - echo -e "${blue}mods-install\t${default}mi |View and install available mods/addons." - echo -e "${blue}mods-update\t${default}mu |Update installed mods/addons." - echo -e "${blue}mods-remove\t${default}mr |Remove installed mods/addons." - } | column -s $'\t' -t - esac -} - -fn_getopt_generic_update_no_steam(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} - -fn_getopt_generic_no_update(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} - -fn_getopt_teamspeak3(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - pw|change-password) - command_ts3_server_pass.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from teamspeak.com." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}change-password\t${default}pw |Changes TS3 serveradmin password." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} - -fn_getopt_minecraft(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from mojang.com." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - } | column -s $'\t' -t - esac -} - -fn_getopt_mta(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ir|install-default-resources) - command_install_resources_mta.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from linux.mtasa.com." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from linux.mtasa.com." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}install-default-resources\t${default}ir |Install the MTA default resources." - } | column -s $'\t' -t - esac -} - -fn_getopt_mumble(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - dev|dev-debug) - command_dev_debug.sh;; - c|console) - command_console.sh;; - i|install) - command_install.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from GitHub." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - } | column -s $'\t' -t - esac -} - -fn_getopt_dstserver(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - ct|cluster-token) - install_dst_token.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}cluster-token\t${default}ct |Configure cluster token." - } | column -s $'\t' -t - esac -} - -fn_getopt_gmodserver(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - fd|fastdl) - command_fastdl.sh;; - mi|mods-install) - command_mods_install.sh;; - mu|mods-update) - command_mods_update.sh;; - mr|mods-remove) - command_mods_remove.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}fastdl\t${default}fd |Generates or update a FastDL directory for your server." - echo -e "${blue}mods-install\t${default}mi |View and install available mods/addons." - echo -e "${blue}mods-update\t${default}mu |Update installed mods/addons." - echo -e "${blue}mods-remove\t${default}mr |Remove installed mods/addons." - } | column -s $'\t' -t - esac -} - -fn_getopt_rustserver(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - pd|postdetails) - command_postdetails.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - mi|mods-install) - command_mods_install.sh;; - mu|mods-update) - command_mods_update.sh;; - mr|mods-remove) - command_mods_remove.sh;; - wi|wipe) - command_wipe.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}mods-install\t${default}mi |View and install available mods/addons." - echo -e "${blue}mods-update\t${default}mu |Update installed mods/addons." - echo -e "${blue}mods-remove\t${default}mr |Remove installed mods/addons." - echo -e "${blue}wipe\t${default}wi |Wipe your Rust server." - } | column -s $'\t' -t - esac -} - -fn_getopt_unreal(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - mc|map-compressor) - compress_ut99_maps.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." - } | column -s $'\t' -t - esac -} +### Define all commands here ### +## User commands | Trigger commands | Description +# Standard commands +cmd_install=( "i;install" "command_install.sh" "Install the server." ) +cmd_auto_install=( "ai;auto-install" "command_autoinstall.sh" "Install the server without prompts." ) +cmd_start=( "st;start" "command_start.sh" "Start the server." ) +cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) +cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) +cmd_details=( "dt;details" "command_details.sh" "Display relevant server information." ) +cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post stripped details to pastebin for support." ) +cmd_backup=( "b;backup;" "command_backup.sh" "Create archives of the server." ) +cmd_update_functions=( "uf;update-functions" "command_update_functions.sh" "Update LinuxGSM functions." ) +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 it if crashed." ) +# 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." ) +# Update servers only +cmd_update=( "u;update" "command_update.sh" "Check for updates and apply if available." ) +cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Unconditionally update the server." ) +# SteamCMD servers only +cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) +# Server with mods-install +cmd_mods_install=( "mi;mods-install" "command_mods_install.sh" "View and install available mods/addons." ) +cmd_mods_remove=( "mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon." ) +cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mods/addons." ) +# Server specific +cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) +cmd_install_default_ressources=( "ir;install-default-ressources" "command_install_resources_mta.sh" "Install the MTA default resources." ) +cmd_wipe=( "wi;wipe" "command_wipe.sh" "Wipe your server data." ) +cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) +cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) +cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) +cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) +# Dev commands +cmd_dev_detect_deps=( "dd;detect-depts" "command_dev_detect_deps.sh" "Detect server dependencies." ) +cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect server glibc requirements." ) +cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect server ldd requirements." ) + +### Set specific opt here ### + +## Common opt to all servers + +currentopt=( "${cmd_install[@]}" "${cmd_auto_install[@]}" "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_details[@]}" ) +currentopt+=( "${cmd_backup[@]}" "${cmd_update_functions[@]}" "${cmd_test_alert[@]}" "${cmd_monitor[@]}" ) + +## Servers that do not have a feature + +# Exclude games without a console +if [ "${gamename}" != "TeamSpeak 3" ]; then + currentopt+=( "${cmd_console[@]}" ) +fi +# Exclude noupdated games here +if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${gamename}" != "Call of Duty" ]&&[ "${gamename}" != "Call of Duty: United Offensive" ]&&[ "${gamename}" != "Call of Duty 2" ]&&[ "${gamename}" != "Call of Duty 4" ]&&[ "${gamename}" != "Call of Duty: World at War" ]&&[ "${gamename}" != "QuakeWorld" ]&&[ "${gamename}" != "Quake 2" ]&&[ "${gamename}" != "Quake 3: Arena" ]&&[ "${gamename}" != "Wolfenstein: Enemy Territory" ]; then + currentopt+=( "${cmd_update[@]}" ) +fi +## Include games that have access to specific commands +# Validate command +if [ -n "${appid}" ]; then + currentopt+=( "${cmd_validate[@]}" ) +fi +# FastDL command +if [ "${engine}" == "source" ]; then + currentopt+=( "${cmd_fastdl[@]}" ) +fi +# Wipe command +if [ "${gamename}" == "Rust" ]; then + currentopt+=( "${cmd_wipe[@]}" ) +fi +# Mods commands +if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]|[ "${gamename}" == "Hurtworld" ]|[ "${gamename}" == "7 Days To Die" ]; then + currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) +fi -fn_getopt_unreal2(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - u|update) - command_update.sh;; - fu|force-update|update-restart) - forceupdate=1; - command_update.sh;; - uf|update-functions) - command_update_functions.sh;; - v|validate) - command_validate.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - mc|map-compressor) - compress_unreal2_maps.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 +## Game server exclusive commands +# TeamSpeak exclusive +if [ "${gamename}" == "TeamSpeak 3" ]; then + currentopt+=( "${cmd_change_password[@]}" ) +fi +# Unreal exclusive +if [ "${engine}" == "unreal2" ]; then + if [ "${gamename}" == "Unreal Tournament 2004" ]; then + currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) + else + currentopt+=( "${cmd_map_compressor_u2[@]}" ) fi - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "https://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "${lightyellow}Commands${default}" - { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update\t${default}Checks and applies updates from SteamCMD." - echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." - } | column -s $'\t' -t - esac -} +fi +if [ "${engine}" == "unreal" ]; then + currentopt+=( "${cmd_map_compressor_u99[@]}" ) +fi +# DST exclusive +if [ "${gamename}" == "Don't Starve Together" ]; then + currentopt+=( "${cmd_install_dst_token[@]}" ) +fi +# MTA exclusive +if [ "${gamename}" == "Multi Theft Auto" ]; then + currentopt+=( "${cmd_install_default_ressources[@]}" ) +fi -fn_getopt_ut2k4(){ -case "${getopt}" in - st|start) - command_start.sh;; - sp|stop) - command_stop.sh;; - r|restart) - command_restart.sh;; - uf|update-functions) - command_update_functions.sh;; - m|monitor) - command_monitor.sh;; - ta|test-alert) - command_test_alert.sh;; - dt|details) - command_details.sh;; - b|backup) - command_backup.sh;; - c|console) - command_console.sh;; - d|debug) - command_debug.sh;; - dev|dev-debug) - command_dev_debug.sh;; - i|install) - command_install.sh;; - ai|auto-install) - fn_autoinstall;; - cd|server-cd-key) - install_ut2k4_key.sh;; - mc|map-compressor) - compress_unreal2_maps.sh;; - dd|detect-deps) - command_dev_detect_deps.sh;; - dg|detect-glibc) - command_dev_detect_glibc.sh;; - dl|detect-ldd) - command_dev_detect_ldd.sh;; - *) - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi +### Build list of available commands +optcommands=() +index="0" +for ((index="0"; index <= ${#currentopt[@]}; index+3)); do + cmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" + for ((cmdindex=1; cmdindex <= ${cmdamount}; cmdindex++)); do + optcommands+=( "$(echo "${currentopt[index]}"| awk -F ';' '{ print $cmdindex }')" ) + done +done + +### Check if user command exists or run the command +if [ ! " ${optcommands[@]} " =~ "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 echo "Usage: $0 [option]" echo "${gamename} - Linux Game Server Manager - Version ${version}" echo "https://gameservermanagers.com/${selfname}" echo -e "" echo -e "${lightyellow}Commands${default}" + # Display available commands + index="0" { - echo -e "${blue}start\t${default}st |Start the server." - echo -e "${blue}stop\t${default}sp |Stop the server." - echo -e "${blue}restart\t${default}r |Restart the server." - echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." - echo -e "${blue}monitor\t${default}m |Checks that the server is running." - echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful information about the server." - echo -e "${blue}backup\t${default}b |Create archive of the server." - echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." - echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." - echo -e "${blue}install\t${default}i |Install the server." - echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." - echo -e "${blue}server-cd-key\t${default}cd |Add your server cd key" - echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." + for ((index="0"; index <= ${#currentopt[@]}; index++)); do + echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |"${currentopt[index+2]}" + done } | column -s $'\t' -t - esac -} - -# Don't Starve Together -if [ "${gamename}" == "Don't Starve Together" ]; then - fn_getopt_dstserver -# Garry's Mod -elif [ "${gamename}" == "Garry's Mod" ]; then - fn_getopt_gmodserver -# Minecraft -elif [ "${engine}" == "lwjgl2" ]; then - fn_getopt_minecraft -# Multi Theft Auto -elif [ "${gamename}" == "Multi Theft Auto" ]; then - fn_getopt_mta -# Mumble -elif [ "${gamename}" == "Mumble" ]; then - fn_getopt_mumble -# Teamspeak 3 -elif [ "${gamename}" == "TeamSpeak 3" ]; then - fn_getopt_teamspeak3 -elif [ "${gamename}" == "Rust" ]; then - fn_getopt_rustserver -# Unreal 2 Engine -elif [ "${engine}" == "unreal2" ]; then - if [ "${gamename}" == "Unreal Tournament 2004" ]; then - fn_getopt_ut2k4 - else - fn_getopt_unreal2 - fi -# Unreal Engine -elif [ "${engine}" == "unreal" ]; then - fn_getopt_unreal -# Generic -elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty 4" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then - fn_getopt_generic_no_update -elif [ "${gamename}" == "Factorio" ]; then - fn_getopt_generic_update_no_steam else - fn_getopt_generic + # Seek and run command + index="0" + for ((index="0"; index <= ${#currentopt[@]}; index+3)); do + currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" + for ((currcmdindex=1; cmdindex <= ${currcmdamount}; currcmdindex++)); do + if [ "$(echo "${currentopt[index]}"| awk -F ';' '{ print $cmdindex }')" == "${getopt}" ]; then + # Run command + ${currentopt[index+1]} + break + fi + done + done fi + core_exit.sh From 2dc25226ed7592b0fd6ad7ab29ef0ca3caee2f20 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Mon, 20 Feb 2017 23:40:58 +0100 Subject: [PATCH 029/102] new opt test --- lgsm/functions/core_getopt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index f87b55a0e..94024ff79 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -118,7 +118,7 @@ for ((index="0"; index <= ${#currentopt[@]}; index+3)); do done ### Check if user command exists or run the command -if [ ! " ${optcommands[@]} " =~ "${getopt}" ]; then +if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 echo "Usage: $0 [option]" @@ -130,7 +130,7 @@ if [ ! " ${optcommands[@]} " =~ "${getopt}" ]; then index="0" { for ((index="0"; index <= ${#currentopt[@]}; index++)); do - echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |"${currentopt[index+2]}" + echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |${currentopt[index+2]}" done } | column -s $'\t' -t else From 75547557a8a4e8085a3556de5df16abeaf43ba99 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 00:29:17 +0100 Subject: [PATCH 030/102] fixing awk, probably not infinite loop --- lgsm/functions/core_getopt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 94024ff79..ad5ee730d 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -113,7 +113,7 @@ index="0" for ((index="0"; index <= ${#currentopt[@]}; index+3)); do cmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" for ((cmdindex=1; cmdindex <= ${cmdamount}; cmdindex++)); do - optcommands+=( "$(echo "${currentopt[index]}"| awk -F ';' '{ print $cmdindex }')" ) + optcommands+=( "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" ) done done @@ -139,7 +139,7 @@ else for ((index="0"; index <= ${#currentopt[@]}; index+3)); do currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" for ((currcmdindex=1; cmdindex <= ${currcmdamount}; currcmdindex++)); do - if [ "$(echo "${currentopt[index]}"| awk -F ';' '{ print $cmdindex }')" == "${getopt}" ]; then + if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command ${currentopt[index+1]} break From 1be3076dba3fcd9f7ffd5ea77127db277022190e Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 00:41:14 +0100 Subject: [PATCH 031/102] first loop fixes --- lgsm/functions/core_getopt.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index ad5ee730d..9a2695c86 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -110,9 +110,9 @@ fi ### Build list of available commands optcommands=() index="0" -for ((index="0"; index <= ${#currentopt[@]}; index+3)); do +for ((index="0"; index < ${#currentopt[@]}; index+=3)); do cmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((cmdindex=1; cmdindex <= ${cmdamount}; cmdindex++)); do + for ((cmdindex=1; cmdindex < ${cmdamount}; cmdindex++)); do optcommands+=( "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" ) done done @@ -136,9 +136,9 @@ if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then else # Seek and run command index="0" - for ((index="0"; index <= ${#currentopt[@]}; index+3)); do + for ((index="0"; index < ${#currentopt[@]}; index+=3)); do currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((currcmdindex=1; cmdindex <= ${currcmdamount}; currcmdindex++)); do + for ((currcmdindex=1; cmdindex < ${currcmdamount}; currcmdindex++)); do if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command ${currentopt[index+1]} From d125a72b0732ed3b457f2edcfcf249ea06151986 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 00:58:14 +0100 Subject: [PATCH 032/102] fix --- lgsm/functions/core_getopt.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 9a2695c86..c651f105d 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -16,7 +16,7 @@ cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) cmd_details=( "dt;details" "command_details.sh" "Display relevant server information." ) cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post stripped details to pastebin for support." ) -cmd_backup=( "b;backup;" "command_backup.sh" "Create archives of the server." ) +cmd_backup=( "b;backup" "command_backup.sh" "Create archives of the server." ) cmd_update_functions=( "uf;update-functions" "command_update_functions.sh" "Update LinuxGSM functions." ) 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 it if crashed." ) @@ -112,16 +112,18 @@ optcommands=() index="0" for ((index="0"; index < ${#currentopt[@]}; index+=3)); do cmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((cmdindex=1; cmdindex < ${cmdamount}; cmdindex++)); do + for ((cmdindex=1; cmdindex <= ${cmdamount}; cmdindex++)); do optcommands+=( "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" ) done done ### Check if user command exists or run the command -if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - echo "Usage: $0 [option]" +if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]||[ -z "${getopt}" ]; then + if [ -z "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + echo "Usage: $0 [option]" + fi echo "${gamename} - Linux Game Server Manager - Version ${version}" echo "https://gameservermanagers.com/${selfname}" echo -e "" @@ -129,7 +131,7 @@ if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then # Display available commands index="0" { - for ((index="0"; index <= ${#currentopt[@]}; index++)); do + for ((index="0"; index <= ${#currentopt[@]}; index+=3)); do echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |${currentopt[index+2]}" done } | column -s $'\t' -t From 3cafcc0e684a2a3f58cd6b825f697243fa3dbe21 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 01:11:07 +0100 Subject: [PATCH 033/102] fixes --- lgsm/functions/core_getopt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index c651f105d..22adbb52d 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -131,8 +131,8 @@ if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]||[ -z "${getopt}" ]; then # Display available commands index="0" { - for ((index="0"; index <= ${#currentopt[@]}; index+=3)); do - echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }') |${currentopt[index+2]}" + for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t|${currentopt[index+2]}" done } | column -s $'\t' -t else @@ -141,7 +141,7 @@ else for ((index="0"; index < ${#currentopt[@]}; index+=3)); do currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" for ((currcmdindex=1; cmdindex < ${currcmdamount}; currcmdindex++)); do - if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" == "${getopt}" ]; then + if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command ${currentopt[index+1]} break From cfc5bf75fc19eff39c6c3afabffb1cc3462deb17 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 01:16:42 +0100 Subject: [PATCH 034/102] fixes --- lgsm/functions/core_getopt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 22adbb52d..6b230b5f8 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -118,8 +118,8 @@ for ((index="0"; index < ${#currentopt[@]}; index+=3)); do done ### Check if user command exists or run the command -if [[ ! "${optcommands[@]}" =~ "${getopt}" ]]||[ -z "${getopt}" ]; then - if [ -z "${getopt}" ]; then +if [ -z "${getopt}" ]||[[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then + if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 echo "Usage: $0 [option]" @@ -140,7 +140,7 @@ else index="0" for ((index="0"; index < ${#currentopt[@]}; index+=3)); do currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((currcmdindex=1; cmdindex < ${currcmdamount}; currcmdindex++)); do + for ((currcmdindex=1; currcmdindex < ${currcmdamount}; currcmdindex++)); do if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command ${currentopt[index+1]} From 007a373d5d7205a30fcdfe29e90b87101b22849b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 01:19:11 +0100 Subject: [PATCH 035/102] appearance --- lgsm/functions/core_getopt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 6b230b5f8..7e02b584a 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -122,17 +122,17 @@ if [ -z "${getopt}" ]||[[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then if [ -n "${getopt}" ]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 - echo "Usage: $0 [option]" fi echo "${gamename} - Linux Game Server Manager - Version ${version}" echo "https://gameservermanagers.com/${selfname}" + echo "Usage: $0 [option]" echo -e "" echo -e "${lightyellow}Commands${default}" # Display available commands index="0" { for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - echo -e "${blue}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t|${currentopt[index+2]}" + echo -e "${cyan}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t|${currentopt[index+2]}" done } | column -s $'\t' -t else From 021a86c737b925f8e412214d8e1ecf7ad882235b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 01:35:21 +0100 Subject: [PATCH 036/102] missing commands --- lgsm/functions/core_getopt.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 7e02b584a..884a0f9c9 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -40,6 +40,7 @@ cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) +cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." # Dev commands cmd_dev_detect_deps=( "dd;detect-depts" "command_dev_detect_deps.sh" "Detect server dependencies." ) cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect server glibc requirements." ) @@ -56,11 +57,11 @@ currentopt+=( "${cmd_backup[@]}" "${cmd_update_functions[@]}" "${cmd_test_alert[ # Exclude games without a console if [ "${gamename}" != "TeamSpeak 3" ]; then - currentopt+=( "${cmd_console[@]}" ) + currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) fi # Exclude noupdated games here if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${gamename}" != "Call of Duty" ]&&[ "${gamename}" != "Call of Duty: United Offensive" ]&&[ "${gamename}" != "Call of Duty 2" ]&&[ "${gamename}" != "Call of Duty 4" ]&&[ "${gamename}" != "Call of Duty: World at War" ]&&[ "${gamename}" != "QuakeWorld" ]&&[ "${gamename}" != "Quake 2" ]&&[ "${gamename}" != "Quake 3: Arena" ]&&[ "${gamename}" != "Wolfenstein: Enemy Territory" ]; then - currentopt+=( "${cmd_update[@]}" ) + currentopt+=( "${cmd_update[@]}" "${cmd_force_update[@]}") fi ## Include games that have access to specific commands @@ -123,9 +124,9 @@ if [ -z "${getopt}" ]||[[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 fi + echo "Usage: $0 [option]" echo "${gamename} - Linux Game Server Manager - Version ${version}" echo "https://gameservermanagers.com/${selfname}" - echo "Usage: $0 [option]" echo -e "" echo -e "${lightyellow}Commands${default}" # Display available commands From b9162f1c69079d4508f710a3c4f9f5529351940d Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 01:36:30 +0100 Subject: [PATCH 037/102] hm ) --- lgsm/functions/core_getopt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 884a0f9c9..914ab0790 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -40,7 +40,7 @@ cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) -cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." +cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) # Dev commands cmd_dev_detect_deps=( "dd;detect-depts" "command_dev_detect_deps.sh" "Detect server dependencies." ) cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect server glibc requirements." ) From edf5b787a941699620d40e79a291cfb8446ab4bf Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 02:36:08 +0100 Subject: [PATCH 038/102] fix for full commands to work --- lgsm/functions/core_getopt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 914ab0790..52f72dfaa 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -141,7 +141,7 @@ else index="0" for ((index="0"; index < ${#currentopt[@]}; index+=3)); do currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((currcmdindex=1; currcmdindex < ${currcmdamount}; currcmdindex++)); do + for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command ${currentopt[index+1]} From 6e8afb5e2a01b0545eb19b1330def039a6dd3ef0 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 02:53:09 +0100 Subject: [PATCH 039/102] dev commands --- lgsm/functions/core_getopt.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 52f72dfaa..a8374493f 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -42,9 +42,10 @@ cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server c cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) # Dev commands -cmd_dev_detect_deps=( "dd;detect-depts" "command_dev_detect_deps.sh" "Detect server dependencies." ) -cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect server glibc requirements." ) -cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect server ldd requirements." ) +cmd_dev_debug=( "dev;dev-debug" "command_dev_debug.sh" "DEVCOMMAND" +cmd_dev_detect_deps=( "dd;detect-depts" "command_dev_detect_deps.sh" "DEVCOMMAND" ) +cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "DEVCOMMAND" ) +cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "DEVCOMMAND" ) ### Set specific opt here ### @@ -107,6 +108,9 @@ if [ "${gamename}" == "Multi Theft Auto" ]; then currentopt+=( "${cmd_install_default_ressources[@]}" ) fi +## Developer commands +currentopt+=( "${cmd_dev_debug[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" ) + ### Build list of available commands optcommands=() @@ -133,7 +137,10 @@ if [ -z "${getopt}" ]||[[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then index="0" { for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - echo -e "${cyan}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t|${currentopt[index+2]}" + # Hide developer commands + if [ "${currentopt[index+3]}" != "DEVCOMMAND" ]; then + echo -e "${cyan}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index+2]}" + fi done } | column -s $'\t' -t else From 73be10ffa08ab3ba04519724e4740f263ecac257 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 02:54:22 +0100 Subject: [PATCH 040/102] typo + missing ) --- lgsm/functions/core_getopt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index a8374493f..a8ddc89b0 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -42,8 +42,8 @@ cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server c cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) # Dev commands -cmd_dev_debug=( "dev;dev-debug" "command_dev_debug.sh" "DEVCOMMAND" -cmd_dev_detect_deps=( "dd;detect-depts" "command_dev_detect_deps.sh" "DEVCOMMAND" ) +cmd_dev_debug=( "dev;dev-debug" "command_dev_debug.sh" "DEVCOMMAND" ) +cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "DEVCOMMAND" ) cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "DEVCOMMAND" ) cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "DEVCOMMAND" ) From a49de6bcbd878e3233b5026cfa4efe54da1527e5 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 03:21:05 +0100 Subject: [PATCH 041/102] new algorithm to find commands --- lgsm/functions/core_getopt.sh | 51 ++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index a8ddc89b0..55f4c3beb 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -122,13 +122,10 @@ for ((index="0"; index < ${#currentopt[@]}; index+=3)); do done done -### Check if user command exists or run the command -if [ -z "${getopt}" ]||[[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then - if [ -n "${getopt}" ]; then - echo -e "${red}Unknown command${default}: $0 ${getopt}" - exitcode=2 - fi +# Shows LinuxGSM usage +fn_opt_usage(){ echo "Usage: $0 [option]" + echo -e "" echo "${gamename} - Linux Game Server Manager - Version ${version}" echo "https://gameservermanagers.com/${selfname}" echo -e "" @@ -143,19 +140,35 @@ if [ -z "${getopt}" ]||[[ ! "${optcommands[@]}" =~ "${getopt}" ]]; then fi done } | column -s $'\t' -t -else - # Seek and run command - index="0" - for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do - if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then - # Run command - ${currentopt[index+1]} - break - fi - done - done + core_exit.sh +} + +### Check if user commands exist and run corresponding scripts, or display script usage +if [ -z "${getopt}" ]; then + fn_opt_usage fi +# Command exists +for i in "${optcommands[@]}"; do + if [ "${i}" == "${getopt}" ] ; then + # Seek and run command + index="0" + for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" + for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do + if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then + # Run command + ${currentopt[index+1]} + break + fi + done + done + break + core_exit.sh + fi +done +# If we're executing this, it means command was not found +echo -e "${red}Unknown command${default}: $0 ${getopt}" +exitcode=2 +fn_opt_usage core_exit.sh From f126f52de9e83918b8066351b7d91e08586d2ed2 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Feb 2017 03:23:50 +0100 Subject: [PATCH 042/102] hide "DEVCOMMAND" description commands --- lgsm/functions/core_getopt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 55f4c3beb..78b097398 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -135,7 +135,7 @@ fn_opt_usage(){ { for ((index="0"; index < ${#currentopt[@]}; index+=3)); do # Hide developer commands - if [ "${currentopt[index+3]}" != "DEVCOMMAND" ]; then + if [ "${currentopt[index+2]}" != "DEVCOMMAND" ]; then echo -e "${cyan}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index+2]}" fi done From 9b62ec9fd454e9b62ced634bd0650657eec6f91f Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 22 Feb 2017 18:06:38 +0100 Subject: [PATCH 043/102] Removed chivalry for now --- ChivalryMedievalWarfare/chivalrymwserver | 199 ----------------------- 1 file changed, 199 deletions(-) delete mode 100644 ChivalryMedievalWarfare/chivalrymwserver diff --git a/ChivalryMedievalWarfare/chivalrymwserver b/ChivalryMedievalWarfare/chivalrymwserver deleted file mode 100644 index 6fd0d8ff0..000000000 --- a/ChivalryMedievalWarfare/chivalrymwserver +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2017 Daniel Gibbs -# Purpose: Chivalry: Medieval Warfare | Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki -# Website: https://gameservermanagers.com - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="170219" - -########################## -######## Settings ######## -########################## - -#### Server Settings #### - -## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters -ip="0.0.0.0" -port="7777" -queryport="27960" - -## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters -fn_parms(){ -parms="aocffa-moor_p\?steamsockets\?port=${port}\?queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog} -seekfreeloadingserver" -} - -#### LinuxGSM Settings #### - -## Notification Alerts -# (on|off) -# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update -updateonstart="off" - -## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging -consolelogging="on" -logdays="7" - -#### LinuxGSM Advanced Settings #### - -## SteamCMD Settings -# Server appid -appid="220070" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" -branch="" - -## Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" - -## LinuxGSM Server Details -# Do not edit -gamename="Chivalry: Medieval Warfare" -engine="unreal3" - -## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers -servicename="chivalrymw-server" - -#### Directories #### -# Edit with care - -## Work Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -lockselfname=".${servicename}.lock" -lgsmdir="${rootdir}/lgsm" -functionsdir="${lgsmdir}/functions" -libdir="${lgsmdir}/lib" -tmpdir="${lgsmdir}/tmp" -filesdir="${rootdir}/serverfiles" - -## Server Specific Directories -systemdir="${filesdir}" -executabledir="${filesdir}/Binaries/Linux/" -executable="./UDKGameServer-Linux" -servercfg="PCServer-UDKGame.ini" -servercfgdefault="PCServer-UDKGame.ini" -servercfgdir="${systemdir}/UDKGame/Config" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${rootdir}/backups" - -## Logging Directories -gamelogdir="${rootdir}/log/server" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" -gamelog="${gamelogdir}/${servicename}-game.log" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -## Logs Naming -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" - -######################## -######## Script ######## -###### Do not edit ##### -######################## - -# Fetches core_dl for file downloads -fn_fetch_core_dl(){ -github_file_url_dir="lgsm/functions" -github_file_url_name="${functionfile}" -filedir="${functionsdir}" -filename="${github_file_url_name}" -githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" -# If the file is missing, then download -if [ ! -f "${filedir}/${filename}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir -p "${filedir}" - fi - echo -e " fetching ${filename}...\c" - # Check curl exists and use available path - curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" - for curlcmd in ${curlpaths} - do - if [ -x "${curlcmd}" ]; then - break - fi - done - # If curl exists download file - if [ "$(basename ${curlcmd})" == "curl" ]; then - curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curlfetch}" - echo -e "${githuburl}\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" - fi - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit 1 - fi - chmod +x "${filedir}/${filename}" -fi -source "${filedir}/${filename}" -} - -core_dl.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -core_functions.sh(){ -# Functions are defined in core_functions.sh. -functionfile="${FUNCNAME}" -fn_fetch_core_dl -} - -# Prevent from running this script as root. -if [ "$(whoami)" = "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -core_dl.sh -core_functions.sh -getopt=$1 -core_getopt.sh From 3f9eeb42192993f221b8a16fd4add7fd43b09d54 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 23 Feb 2017 02:55:40 +0100 Subject: [PATCH 044/102] Slight improvement to Rust Wipe feature More safety with rm -r "${var:?}" instead of rm -r "${var}" even though there is an if [ -d "${var}" ] check before And now also removes map file, not only map save. --- lgsm/functions/command_wipe.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index 67ea65164..27ccfbf2f 100644 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -45,11 +45,24 @@ fn_wipe_server_remove_files(){ # Rust Wipe if [ "${gamename}" == "Rust" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.sav")" ]; then - currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.sav" - echo -en "Removing map proceduralmap.*.sav file(s)..." + currentaction="Removing map save(s): ${serveridentitydir}/proceduralmap.*.sav" + echo -en "Removing map saves proceduralmap.*.sav file(s)..." sleep 1 fn_script_log "${currentaction}" - find "${serveridentitydir}" -type f -name "proceduralmap.*.sav" -delete + find "${serveridentitydir:?}" -type f -name "proceduralmap.*.sav" -delete + fn_wipe_exit_code + sleep 0.5 + else + fn_print_information_nl "No map save to remove" + fn_script_log_info "No map save to remove." + sleep 0.5 + fi + if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then + currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.map" + echo -en "Removing map proceduralmap.*.map file(s)..." + sleep 1 + fn_script_log "${currentaction}" + find "${serveridentitydir:?}" -type f -name "proceduralmap.*.map" -delete fn_wipe_exit_code sleep 0.5 else @@ -62,7 +75,7 @@ fn_wipe_server_remove_files(){ echo -en "Removing user directory..." sleep 1 fn_script_log "${currentaction}" - rm -rf "${serveridentitydir}/user" + rm -rf "${serveridentitydir:?}/user" fn_wipe_exit_code sleep 0.5 else @@ -75,7 +88,7 @@ fn_wipe_server_remove_files(){ echo -en "Removing storage directory..." sleep 1 fn_script_log "${currentaction}" - rm -rf "${serveridentitydir}/storage" + rm -rf "${serveridentitydir:?}/storage" fn_wipe_exit_code sleep 0.5 else @@ -88,7 +101,7 @@ fn_wipe_server_remove_files(){ echo -en "Removing Log files..." sleep 1 fn_script_log "${currentaction}" - find "${serveridentitydir}" -type f -name "Log.*.txt" -delete + find "${serveridentitydir:?}" -type f -name "Log.*.txt" -delete fn_wipe_exit_code sleep 0.5 else From 99aeb89b8594b065bc5d7bc3784e3ff23ed26aec Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 23 Feb 2017 03:39:13 +0100 Subject: [PATCH 045/102] fn_print_header As per #1035 --- lgsm/functions/compress_ut99_maps.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index 2a3b6a71f..e74ec727c 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -8,9 +8,7 @@ local commandaction="Unreal Map Compressor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh -clear -echo "${gamename} Map Compressor" -echo "=================================" +fn_print_header echo "Will compress all maps in:" echo "" pwd From a45412c175100721b0470d69a5fb72d69f87dd77 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 23 Feb 2017 03:39:15 +0100 Subject: [PATCH 046/102] fn_print_header As per #1035 --- lgsm/functions/compress_unreal2_maps.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 9e0488095..7ef8bfeea 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -8,9 +8,7 @@ local commandaction="Unreal Map Compressor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh -clear -echo "${gamename} Map Compressor" -echo "=================================" +fn_print_header echo "Will compress all maps in:" echo "" pwd From dd55ccf979689812fa6e5d8f17ed7bb94a340597 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 23 Feb 2017 03:41:53 +0100 Subject: [PATCH 047/102] fn_print_header As per #1035 --- lgsm/functions/command_ts3_server_pass.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index 5cdb59e6c..964b93211 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -6,15 +6,12 @@ # Description: Changes TS3 serveradmin password. local commandname="TS3-CHANGE-PASS" -local commandaction="TS3 Change Password" +local commandaction="ServerAdmin Password Change" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_serveradmin_password_prompt(){ - echo "" - echo "${gamename} ServerAdmin Password Change" - echo "=================================" - echo "" + fn_print_header echo "Press \"CTRL+b d\" to exit console." fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password." fn_print_warning_nl "${gamename} will restart during this process." From 10396a233478bd6c3b50aaddbf3d224c37253ae3 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 23 Feb 2017 03:54:03 +0100 Subject: [PATCH 048/102] Minor log issue fix Fixes #1307 --- lgsm/functions/command_start.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 39dc363cf..c544dd9cf 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -85,15 +85,15 @@ fn_start_tmux(){ # tmux pipe-pane not supported in tmux versions < 1.6 if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then - echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}" - echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" + echo "Console logging disabled: Tmux => 1.6 required + https://gameservermanagers.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" # Console logging disabled: Bug in tmux 1.8 breaks logging elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then - echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}" - echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" + echo "Console logging disabled: Bug in tmux 1.8 breaks logging + https://gameservermanagers.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" # Console logging enable or not set elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then From 9dae232b4af4e27003f0f99986435a89881cd38a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 23 Feb 2017 09:02:19 +0100 Subject: [PATCH 049/102] Try reverting changes to check why travis fails --- lgsm/functions/command_start.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index c544dd9cf..39dc363cf 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -85,15 +85,15 @@ fn_start_tmux(){ # tmux pipe-pane not supported in tmux versions < 1.6 if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then - echo "Console logging disabled: Tmux => 1.6 required - https://gameservermanagers.com/tmux-upgrade - Currently installed: $(tmux -V)" > "${consolelog}" + echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}" + echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" + echo "Currently installed: $(tmux -V)" >> "${consolelog}" # Console logging disabled: Bug in tmux 1.8 breaks logging elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then - echo "Console logging disabled: Bug in tmux 1.8 breaks logging - https://gameservermanagers.com/tmux-upgrade - Currently installed: $(tmux -V)" > "${consolelog}" + echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}" + echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" + echo "Currently installed: $(tmux -V)" >> "${consolelog}" # Console logging enable or not set elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then From ed51b44818a070f2c8289af4050572538cbe60d4 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 23 Feb 2017 09:21:18 +0100 Subject: [PATCH 050/102] Minor log issue fix (again) Trying to re-add the commit to see if it was just a temporary Travis bug or not. Fixes #1307 (again) --- lgsm/functions/command_start.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 39dc363cf..c544dd9cf 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -85,15 +85,15 @@ fn_start_tmux(){ # tmux pipe-pane not supported in tmux versions < 1.6 if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then - echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}" - echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" + echo "Console logging disabled: Tmux => 1.6 required + https://gameservermanagers.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" # Console logging disabled: Bug in tmux 1.8 breaks logging elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then - echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}" - echo "https://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" + echo "Console logging disabled: Bug in tmux 1.8 breaks logging + https://gameservermanagers.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" # Console logging enable or not set elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then From 98854eacffbff62e01891d57cde7d5e32f7e6d67 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 25 Feb 2017 01:03:23 +0100 Subject: [PATCH 051/102] Fixed function syntax breaking Ark stop Fixes #1335 --- lgsm/functions/command_stop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 341ad4d95..ccb7dbbf0 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -272,7 +272,7 @@ fn_stop_ark(){ pid=${pid//[!0-9]/} let pid+=0 # turns an empty string into a valid number, '0', # and a valid numeric pid remains unchanged. - if [ "${pid}" -gt 1 && "${pid}" -le $(cat /proc/sys/kernel/pid_max) ]; then + if [ "${pid}" -gt 1 ]&&[ "${pid}" -le $(cat /proc/sys/kernel/pid_max) ]; then fn_print_dots "Process still bound. Awaiting graceful exit: ${pidcheck}" sleep 1 else From e59865c6aaf8e9ecc4aa879836d4462c7fa645b5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 00:32:53 +0000 Subject: [PATCH 052/102] Removed insecure from Codename CURE servers are now VAC protected --- CodenameCURE/ccserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver index 7220ec4d8..63ca1091c 100644 --- a/CodenameCURE/ccserver +++ b/CodenameCURE/ccserver @@ -32,7 +32,7 @@ ip="0.0.0.0" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters fn_parms(){ -parms="-game cure -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game cure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" } #### LinuxGSM Settings #### From f8b95ab9b8698cfd86b3e529ed22dfcc937be7f4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 11:15:43 +0000 Subject: [PATCH 053/102] TF2 now required libcurl --- lgsm/functions/check_deps.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index a159f858c..a256c6abc 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -180,8 +180,8 @@ if [ -n "$(command -v dpkg-query)" ]; then else array_deps_required+=( libtinfo5 ) fi - # Brainbread 2 and Don't Starve Together - elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then + # Brainbread 2 ,Don't Starve Together & Team Fortress 2 + elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]||[ "${gamename}" == "Team Fortress 2" ]; then array_deps_required+=( libcurl4-gnutls-dev:i386 ) # Battlefield: 1942 elif [ "${gamename}" == "Battlefield: 1942" ]; then @@ -255,8 +255,8 @@ elif [ -n "$(command -v yum)" ]; then # No More Room in Hell, Counter-Strike: Source and Garry's Mod elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]; then array_deps_required+=( ncurses-libs.i686 ) - # Brainbread 2 and Don't Starve Together - elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then + # Brainbread 2, Don't Starve Together & Team Fortress 2 + elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]||[ "${gamename}" == "Team Fortress 2" ]; then array_deps_required+=( libcurl.i686 ) # Battlefield: 1942 elif [ "${gamename}" == "Battlefield: 1942" ]; then From 5ac52b631d38f9fc3bd3768676091206aa880554 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 11:39:02 +0000 Subject: [PATCH 054/102] removed white spaces --- lgsm/functions/command_fastdl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 5d20df759..3d39f49ea 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -122,7 +122,7 @@ fn_fastdl_config(){ else clearnonbzip2="off"; fn_script_log "Clearing non-bzip2 files Disabled."; fn_print_ok "Clearing non-bzip2 files Disabled" fi - echo -en "\n" + echo -en "\n" else # Other games default remove non bzip2 files clearnonbzip2="on" @@ -174,7 +174,7 @@ fn_fastdl_gmod(){ # No choice to cd to the directory, as find can't then display relative directory cd "${systemdir}" || exit - + # Map Files fn_print_dots "Copying map files..." fn_script_log "Copying map files" @@ -408,7 +408,7 @@ fn_fastdl_bzip2(){ find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -exec rm {} \; fn_print_ok "Cleared uncompressed FastDL files" fn_script_log "Cleared uncompressed FastDL files." - fi + fi fi } From fca87cde2d65b3ffbc360b58697f78fb83ced75e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 14:11:51 +0000 Subject: [PATCH 055/102] Changed noupdate servers to use engines shortens the if statement --- lgsm/functions/core_getopt.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 78b097398..0889dbd19 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -34,7 +34,7 @@ cmd_mods_remove=( "mr;mods-remove" "command_mods_remove.sh" "View and remove an cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mods/addons." ) # Server specific cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) -cmd_install_default_ressources=( "ir;install-default-ressources" "command_install_resources_mta.sh" "Install the MTA default resources." ) +cmd_install_default_resources=( "ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources." ) cmd_wipe=( "wi;wipe" "command_wipe.sh" "Wipe your server data." ) cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) @@ -61,7 +61,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]; then currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) fi # Exclude noupdated games here -if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${gamename}" != "Call of Duty" ]&&[ "${gamename}" != "Call of Duty: United Offensive" ]&&[ "${gamename}" != "Call of Duty 2" ]&&[ "${gamename}" != "Call of Duty 4" ]&&[ "${gamename}" != "Call of Duty: World at War" ]&&[ "${gamename}" != "QuakeWorld" ]&&[ "${gamename}" != "Quake 2" ]&&[ "${gamename}" != "Quake 3: Arena" ]&&[ "${gamename}" != "Wolfenstein: Enemy Territory" ]; then +if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&; then currentopt+=( "${cmd_update[@]}" "${cmd_force_update[@]}") fi @@ -79,7 +79,7 @@ if [ "${gamename}" == "Rust" ]; then currentopt+=( "${cmd_wipe[@]}" ) fi # Mods commands -if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]|[ "${gamename}" == "Hurtworld" ]|[ "${gamename}" == "7 Days To Die" ]; then +if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "7 Days To Die" ]; then currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) fi @@ -105,7 +105,7 @@ if [ "${gamename}" == "Don't Starve Together" ]; then fi # MTA exclusive if [ "${gamename}" == "Multi Theft Auto" ]; then - currentopt+=( "${cmd_install_default_ressources[@]}" ) + currentopt+=( "${cmd_install_default_resources[@]}" ) fi ## Developer commands @@ -160,7 +160,7 @@ for i in "${optcommands[@]}"; do ${currentopt[index+1]} break fi - done + done done break core_exit.sh From 8ee9fdbb3cdb49b4707fbba0ba09734229d27115 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 14:33:56 +0000 Subject: [PATCH 056/102] stray && --- lgsm/functions/core_getopt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 0889dbd19..e853ea890 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -61,7 +61,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]; then currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) fi # Exclude noupdated games here -if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&; then +if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]; then currentopt+=( "${cmd_update[@]}" "${cmd_force_update[@]}") fi From 7e1bc80fe1e6e203fea1ec8a065f23badafec04e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 17:36:39 +0000 Subject: [PATCH 057/102] A re shuffle and changed some commands --- lgsm/functions/core_getopt.sh | 66 ++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index e853ea890..1fa60fd69 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -10,14 +10,14 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" ## User commands | Trigger commands | Description # Standard commands cmd_install=( "i;install" "command_install.sh" "Install the server." ) -cmd_auto_install=( "ai;auto-install" "command_autoinstall.sh" "Install the server without prompts." ) +cmd_auto_install=( "ai;auto-install" "fn_autoinstall" "Install the server without prompts." ) cmd_start=( "st;start" "command_start.sh" "Start the server." ) cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) cmd_details=( "dt;details" "command_details.sh" "Display relevant server information." ) cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post stripped details to pastebin for support." ) cmd_backup=( "b;backup" "command_backup.sh" "Create archives of the server." ) -cmd_update_functions=( "uf;update-functions" "command_update_functions.sh" "Update LinuxGSM functions." ) +cmd_update_functions=( "ul;update-lgsm;uf;update-functions" "command_update_functions.sh" "Update LinuxGSM functions." ) 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 it if crashed." ) # Console servers only @@ -25,7 +25,7 @@ cmd_console=( "c;console" "command_console.sh" "Access server console." ) cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." ) # Update servers only cmd_update=( "u;update" "command_update.sh" "Check for updates and apply if available." ) -cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Unconditionally update the server." ) +cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Force update the server." ) # SteamCMD servers only cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) # Server with mods-install @@ -42,46 +42,46 @@ cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server c cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) # Dev commands -cmd_dev_debug=( "dev;dev-debug" "command_dev_debug.sh" "DEVCOMMAND" ) -cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "DEVCOMMAND" ) -cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "DEVCOMMAND" ) -cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "DEVCOMMAND" ) +cmd_dev_debug=( "dev;developer" "command_dev_debug.sh" "Enable developer Mode." ) +cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." ) +cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." ) +cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." ) ### Set specific opt here ### ## Common opt to all servers +currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" ) -currentopt=( "${cmd_install[@]}" "${cmd_auto_install[@]}" "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_details[@]}" ) -currentopt+=( "${cmd_backup[@]}" "${cmd_update_functions[@]}" "${cmd_test_alert[@]}" "${cmd_monitor[@]}" ) - -## Servers that do not have a feature - -# Exclude games without a console -if [ "${gamename}" != "TeamSpeak 3" ]; then - currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) -fi # Exclude noupdated games here if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]; then - currentopt+=( "${cmd_update[@]}" "${cmd_force_update[@]}") + currentopt+=( "${cmd_update[@]}" ) + # force update for SteamCMD only + if [ -n "${appid}" ]; then + currentopt+=( "${cmd_force_update[@]}" ) + fi fi -## Include games that have access to specific commands # Validate command if [ -n "${appid}" ]; then currentopt+=( "${cmd_validate[@]}" ) fi + +# Update LGSM +currentopt+=( "${cmd_update_functions[@]}" ) + +#Backup +currentopt+=( "${cmd_backup[@]}" ) + + +# Exclude games without a console +if [ "${gamename}" != "TeamSpeak 3" ]; then + currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) +fi + # FastDL command if [ "${engine}" == "source" ]; then currentopt+=( "${cmd_fastdl[@]}" ) fi -# Wipe command -if [ "${gamename}" == "Rust" ]; then - currentopt+=( "${cmd_wipe[@]}" ) -fi -# Mods commands -if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "7 Days To Die" ]; then - currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) -fi ## Game server exclusive commands # TeamSpeak exclusive @@ -89,6 +89,9 @@ if [ "${gamename}" == "TeamSpeak 3" ]; then currentopt+=( "${cmd_change_password[@]}" ) fi # Unreal exclusive +if [ "${gamename}" == "Rust" ]; then + currentopt+=( "${cmd_wipe[@]}" ) +fi if [ "${engine}" == "unreal2" ]; then if [ "${gamename}" == "Unreal Tournament 2004" ]; then currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) @@ -108,9 +111,16 @@ if [ "${gamename}" == "Multi Theft Auto" ]; then currentopt+=( "${cmd_install_default_resources[@]}" ) fi -## Developer commands -currentopt+=( "${cmd_dev_debug[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" ) +## Mods commands +if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "7 Days To Die" ]; then + currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) +fi +## Developer commands +currentopt+=( "${cmd_dev_debug[@]}" ) +if [ -f ".dev-debug" ]; then + currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" ) +fi ### Build list of available commands optcommands=() From 0398f33c621f692b8dbe352d1701af381aeb454b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 17:43:24 +0000 Subject: [PATCH 058/102] re wording --- lgsm/functions/core_getopt.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 1fa60fd69..2e46278f1 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -14,18 +14,18 @@ cmd_auto_install=( "ai;auto-install" "fn_autoinstall" "Install the server withou cmd_start=( "st;start" "command_start.sh" "Start the server." ) cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) -cmd_details=( "dt;details" "command_details.sh" "Display relevant server information." ) -cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post stripped details to pastebin for support." ) -cmd_backup=( "b;backup" "command_backup.sh" "Create archives of the server." ) +cmd_details=( "dt;details" "command_details.sh" "Display server information." ) +cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post details to hastebin (removing passwords)." ) +cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the server." ) cmd_update_functions=( "ul;update-lgsm;uf;update-functions" "command_update_functions.sh" "Update LinuxGSM functions." ) 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 it if crashed." ) +cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." ) # 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." ) # Update servers only -cmd_update=( "u;update" "command_update.sh" "Check for updates and apply if available." ) -cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Force update the server." ) +cmd_update=( "u;update" "command_update.sh" "Check and apply any updates." ) +cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Bypass update check and apply any updates." ) # SteamCMD servers only cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) # Server with mods-install From 3229ae3b1fc8702d2605ef056e93310f4e4f0fd0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 17:48:32 +0000 Subject: [PATCH 059/102] minor tidy --- lgsm/functions/core_getopt.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 2e46278f1..3c3fe0f43 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -49,10 +49,9 @@ cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect require ### Set specific opt here ### -## Common opt to all servers currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" ) -# Exclude noupdated games here +# Exclude noupdate games here if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]; then currentopt+=( "${cmd_update[@]}" ) # force update for SteamCMD only @@ -78,16 +77,18 @@ if [ "${gamename}" != "TeamSpeak 3" ]; then currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) fi +## Game server exclusive commands + # FastDL command if [ "${engine}" == "source" ]; then currentopt+=( "${cmd_fastdl[@]}" ) fi -## Game server exclusive commands # TeamSpeak exclusive if [ "${gamename}" == "TeamSpeak 3" ]; then currentopt+=( "${cmd_change_password[@]}" ) fi + # Unreal exclusive if [ "${gamename}" == "Rust" ]; then currentopt+=( "${cmd_wipe[@]}" ) @@ -102,10 +103,12 @@ fi if [ "${engine}" == "unreal" ]; then currentopt+=( "${cmd_map_compressor_u99[@]}" ) fi + # DST exclusive if [ "${gamename}" == "Don't Starve Together" ]; then currentopt+=( "${cmd_install_dst_token[@]}" ) fi + # MTA exclusive if [ "${gamename}" == "Multi Theft Auto" ]; then currentopt+=( "${cmd_install_default_resources[@]}" ) @@ -181,4 +184,4 @@ done echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 fn_opt_usage -core_exit.sh +core_exit.sh \ No newline at end of file From c0891101c17b35b641d082f67f4449d9105767c0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 25 Feb 2017 22:14:36 +0000 Subject: [PATCH 060/102] display fix --- lgsm/functions/mods_core.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 620bfa921..35ab904e4 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -346,7 +346,7 @@ fn_mod_compatible_test(){ fn_create_mods_dir(){ # Create lgsm data modsdir if [ ! -d "${modsdir}" ];then - echo "creating lgsm mods data directory ${modsdir}..." + echo -en "creating LinuxGSM mods data directory ${modsdir}..." mkdir -p "${modsdir}" exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -361,7 +361,7 @@ fn_create_mods_dir(){ fi # Create mod install directory if [ ! -d "${modinstalldir}" ]; then - echo "creating mods install directory ${modinstalldir}..." + echo -en "creating mods install directory ${modinstalldir}..." mkdir -p "${modinstalldir}" exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -438,7 +438,7 @@ fn_mods_check_installed(){ if [ ${installedmodscount} -eq 0 ]; then echo "" fn_print_failure_nl "No installed mods or addons were found" - echo " * Install mods using LGSM first with: ./${selfname} mods-install" + echo " * Install mods using LinuxGSM first with: ./${selfname} mods-install" fn_script_log_error "No installed mods or addons were found." core_exit.sh fi From cd2d7d1f34dae7e928b3d3faabf9cd91322eac0d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Feb 2017 14:56:40 +0000 Subject: [PATCH 061/102] files to fileswc --- lgsm/functions/mods_core.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 35ab904e4..7e9c1cdf9 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -42,7 +42,7 @@ fn_mod_lowercase(){ echo -ne "converting ${modprettyname} files to lowercase..." sleep 0.5 fn_script_log_info "Converting ${modprettyname} files to lowercase" - files=$(find "${extractdir}" -depth | wc -l) + fileswc=$(find "${extractdir}" -depth | wc -l) echo -en "\r" while read -r src; do dst=`dirname "${src}"`/`basename "${src}" | tr '[A-Z]' '[a-z]'` @@ -52,10 +52,10 @@ fn_mod_lowercase(){ local exitcode=$? ((renamedwc++)) fi - echo -ne "${renamedwc} / ${totalfileswc} / $files converting ${modprettyname} files to lowercase..." $'\r' + echo -ne "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r' ((totalfileswc++)) done < <(find "${extractdir}" -depth) - echo -ne "${renamedwc} / ${totalfileswc} / $files converting ${modprettyname} files to lowercase..." + echo -ne "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl From 8c17f44d24bcb31b16dccabd67d6ea94bee245fa Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Feb 2017 14:57:05 +0000 Subject: [PATCH 062/102] Forgot to add installer --- lgsm/functions/core_getopt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 3c3fe0f43..39efa37e4 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -119,6 +119,9 @@ if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]||[ "${gamename}" == currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) fi +## Installer +currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" ) + ## Developer commands currentopt+=( "${cmd_dev_debug[@]}" ) if [ -f ".dev-debug" ]; then From f152d66d55af303bf4e15ee113da71573f685b24 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Feb 2017 15:03:56 +0000 Subject: [PATCH 063/102] altered the look slightly --- lgsm/functions/install_server_dir.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index 12762df57..426e25a2b 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -12,12 +12,11 @@ echo "" echo "Server Directory" echo "=================================" sleep 1 -echo "" -pwd -echo "" if [ -d "${filesdir}" ]; then fn_print_warning_nl "A server is already installed here." fi +pwd +echo "" if [ -z "${autoinstall}" ]; then if ! fn_prompt_yn "Continue?" Y; then exit From 753612106cc1c560f57dc8c6e3cf28c4bfa87185 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Feb 2017 20:31:46 +0000 Subject: [PATCH 064/102] Large refactor of command_fastdl (not finished yet) improving the look and efficiency of teh code --- lgsm/functions/command_fastdl.sh | 481 ++++++++++++++++++------------- 1 file changed, 280 insertions(+), 201 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 5d20df759..3a85ed788 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -6,18 +6,11 @@ # Description: Creates a FastDL directory. local commandname="FASTDL" -local commandaction="FastDL Generator" +local commandaction="FastDL" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh -# Only Source supports FastDL -if [ "${engine}" != "source" ]; then - fn_print_error "${gamename} does not support FastDL" - fn_script_log_error "${gamename} does not support FastDL" - core_exit.sh -fi - # Directories webdir="${rootdir}/public_html" fastdldir="${webdir}/fastdl" @@ -44,123 +37,90 @@ fn_check_bzip2(){ fi } -# Initiates FastDL -fn_fastdl_init(){ - fn_print_header - fn_script_log "Started FastDL Generator" - sleep 1 - fn_check_bzip2 - # User confirmation - if ! fn_prompt_yn "Build FastDL directory?" Y; then - exit - fi - fn_script_log "Initiating FastDL creation" - - # Check and create directories - if [ ! -d "${webdir}" ]; then - echo "" - fn_print_info "Creating FastDL directories" - echo -en "\n" - sleep 1 - fn_print_dots "Creating ${webdir} directory" - sleep 0.5 - mkdir "${webdir}" - fn_print_ok "Created ${webdir} directory" - fn_script_log "FastDL created ${webdir} directory" - sleep 1 - echo -en "\n" - fi - if [ ! -d "${fastdldir}" ]; then - # No directory, won't ask for removing old ones - newfastdl="true" - fn_print_dots "Creating fastdl directory" - sleep 0.5 - mkdir "${fastdldir}" - fn_print_ok "Created fastdl directory" - fn_script_log "Created fastdl directory" - sleep 1 - echo -en "\n" - clearoldfastdl="off" # Nothing to clear - elif [ "$(ls -A "${fastdldir}")" ]; then - newfastdl="false" - else - newfastdl="true" - fi -} - # Prompts user for FastDL creation settings fn_fastdl_config(){ - fn_print_info "Entering configuration" - fn_script_log "Configuration" - sleep 2 - echo -en "\n" + echo "FastDL setup" + echo "=================================" + # Prompt for clearing old files if directory was already here - if [ "${newfastdl}" == "false" ]; then - fn_print_dots - if fn_prompt_yn "Clear old FastDL files?" Y; then - clearoldfastdl="on"; fn_script_log "clearoldfastdl enabled"; fn_print_ok "Clearing Enabled" - else - clearoldfastdl="off"; fn_script_log "clearoldfastdl disabled"; fn_print_ok "Clearing Disabled" - fi - echo -en "\n" - fi - # Settings for bzip2 users - if [ ${bzip2installed} == 1 ]; then - # Prompt for using bzip2 if it's installed - fn_print_dots - if fn_prompt_yn "Enable bzip2 file compression?" Y; then - bzip2enable="on"; fn_script_log "bzip2 enabled"; fn_print_ok "bzip2 Enabled" - else - bzip2enable="off"; fn_script_log "bzip2 disabled"; fn_print_ok "bzip2 Disabled" - fi - echo -en "\n" - if [ "${gamename}" == "Garry's Mod" ]&&[ "${bzip2enable}" == "on" ]; then - # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod - fn_print_dots - if fn_prompt_yn "Clear non-bzip2 FastDL files?" Y; then - clearnonbzip2="on"; fn_script_log "Clearing non-bzip2 files Enabled."; fn_print_ok "Clearing non-bzip2 files Enabled" - else - clearnonbzip2="off"; fn_script_log "Clearing non-bzip2 files Disabled."; fn_print_ok "Clearing non-bzip2 files Disabled" - fi - echo -en "\n" + if [ -d "${fastdldir}" ]; then + fn_print_warning_nl "FastDL directory already exists." + echo "${fastdldir}" + echo "" + if fn_prompt_yn "Overwrite existing directory?" Y; then + clearoldfastdl="on" else - # Other games default remove non bzip2 files - clearnonbzip2="on" - fn_script_log "Original uncompressed fastDL files won't be kept." + clearoldfastdl="off" fi fi + # Garry's Mod Specific if [ "${gamename}" == "Garry's Mod" ]; then # Prompt to clear addons dir from fastdl, can use unnecessary space or be required depending on addon's file structures fn_print_dots if fn_prompt_yn "Clear addons dir from fastdl dir?" Y; then - cleargmodaddons="on"; fn_script_log "Addons clearing Enabled."; fn_print_ok "Addons clearing Enabled" + cleargmodaddons="on"; else - cleargmodaddons="off"; fn_script_log "Addons clearing Disabled."; fn_print_ok "Addons clearing Disabled" + cleargmodaddons="off"; fi - echo -en "\n" + # Prompt for download enforcer, which is using a .lua addfile resource generator fn_print_dots if fn_prompt_yn "Use client download enforcer?" Y; then - luaressource="on"; fn_script_log "DL enforcer Enabled."; fn_print_ok "Enforcer Enabled" + luaressource="on" else - luaressource="off"; fn_script_log "DL enforcer Disabled."; fn_print_ok "Enforcer Disabled" + luaressource="off" fi - echo -en "\n" + fi +} + +fn_fastdl_dirs(){ + # Check and create directories + if [ ! -d "${modsdir}" ];then + echo -en "creating web directory ${webdir}..." + mkdir -p "${webdir}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "creating web directory ${webdir}..." + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "creating web directory ${webdir}..." + fi + sleep 0.5 + fi + if [ ! -d "${fastdldir}" ];then + echo -en "creating fastdl directory ${fastdldir}..." + mkdir -p "${fastdldir}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "creating fastdl directory ${fastdldir}..." + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "creating fastdl directory ${fastdldir}..." + fi + sleep 0.5 fi } fn_clear_old_fastdl(){ # Clearing old FastDL if user answered yes - if [ "${clearoldfastdl}" == "on" ]; then - fn_print_info "Clearing existing FastDL directory" - fn_script_log "Clearing existing FastDL directory" - sleep 0.5 + if [ ! -d "${modsdir}" ];then + echo -en "clearing existing FastDL directory ${fastdldir}..." rm -R "${fastdldir:?}"/* - fn_print_ok "Old FastDL directory cleared" - fn_script_log "Old FastDL directory cleared" - sleep 1 - echo -en "\n" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "clearing existing FastDL directory ${fastdldir}..." + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "clearing existing FastDL directory ${fastdldir}..." + fi + sleep 0.5 fi } @@ -174,7 +134,7 @@ fn_fastdl_gmod(){ # No choice to cd to the directory, as find can't then display relative directory cd "${systemdir}" || exit - + # Map Files fn_print_dots "Copying map files..." fn_script_log "Copying map files" @@ -273,76 +233,206 @@ fn_fastdl_gmod(){ fi } +# Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 +fn_human_readable_file_size() { + local abbrevs=( + $((1 << 60)):ZB + $((1 << 50)):EB + $((1 << 40)):TB + $((1 << 30)):GB + $((1 << 20)):MB + $((1 << 10)):KB + $((1)):bytes + ) + + local bytes="${1}" + local precision="${2}" + + if [[ "${bytes}" == "1" ]]; then + echo "1 byte" + else + for item in "${abbrevs[@]}"; do + local factor="${item%:*}" + local abbrev="${item#*:}" + if [[ "${bytes}" -ge "${factor}" ]]; then + local size="$(bc -l <<< "${bytes} / ${factor}")" + printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" + break + fi + done + fi +} + fn_fastdl_source(){ # Copy all needed files for FastDL - echo "" - fn_print_dots "Starting gathering all needed files" - fn_script_log "Starting gathering all needed files" - sleep 1 - echo -en "\n" + if [ -n "${copyflag}" ]; then + # Removes all existing FastDL files. + if [ -d "${fastdldir}" ]; then + echo -e "removing existing FastDL files" + sleep 0.1 + fileswc=1 + totalfileswc=$(find "${fastdldir}" | wc -l) + tput sc + while read -r filetoremove; do + tput rc; tput el + printf "removing ${fileswc} / ${totalfileswc} : ${filetoremove}..." + ((fileswc++)) + rm -rf "${filetoremove}" + ((exitcode=$?)) + if [ ${exitcode} -ne 0 ]; then + fn_script_log_fatal "Removing ${filetoremove}" + break + else + fn_script_log_pass "Removing ${filetoremove}" + fi + sleep 0.01 + done < <(find "${fastdldir}") + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fi + fn_fastdl_dirs - # Map Files - fn_print_dots "Copying map files..." - fn_script_log "Copying map files" - sleep 0.5 - mkdir "${fastdldir}/maps" - find "${systemdir}/maps" -name '*.bsp' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.ain' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.nav' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.jpg' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.txt' -exec cp {} "${fastdldir}/maps" \; - fn_print_ok "Map files copied" - sleep 0.5 - echo -en "\n" + echo -e "copying files to ${fastdldir}" + fn_script_log "copying files to ${fastdldir}" + else + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + rm -f "${tmpdir}/fastdl_files_to_compress.txt" + fi + echo -e "analyzing required files" + fn_script_log "analyzing required files" + fi + + # Maps + if [ -d "${systemdir}/maps" ]; then + local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + for allowed_extention in "${allowed_extentions_array[@]}" + do + fileswc=0 + tput sc + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering maps ${allowed_extention} : ${fileswc}..." + fi + while read -r mapfile; do + ((fileswc++)) + if [ -n "${copyflag}" ]; then + tput rc; tput el + printf "copying maps ${allowed_extention} : ${fileswc}..." + if [ ! -d "${fastdldir}/maps" ]; then + mkdir "${fastdldir}/maps" + fi + cp "${mapfile}" "${fastdldir}/maps" + else + tput rc; tput el + printf "gathering maps ${allowed_extention} : ${fileswc}..." + sleep 0.01 + echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fi + done < <(find "${systemdir}/maps" -type f -iname ${allowed_extention}) + + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering maps ${allowed_extention} : ${fileswc}..." + fi + if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + fn_print_ok_eol_nl + fi + done + fi # Materials - fn_print_dots "Copying materials..." - fn_script_log "Copying materials" - sleep 0.5 - mkdir "${fastdldir}/materials" - find "${systemdir}/materials" -name '*.vtf' -exec cp {} "${fastdldir}/materials" \; - find "${systemdir}/materials" -name '*.vmt' -exec cp {} "${fastdldir}/materials" \; - find "${systemdir}/materials" -name '*.vbf' -exec cp {} "${fastdldir}/materials" \; - fn_print_ok "Materials copied" - sleep 0.5 - echo -en "\n" + if [ -d "${systemdir}/materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) + for allowed_extention in "${allowed_extentions_array[@]}" + do + while read -r materialfile; do + ((totalfileswc++)) + echo -en "materials: ${allowed_extention} : ${totalfileswc}..." $'\r' + sleep 0.01 + echo "${materialfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find "${systemdir}/materials" -type f -iname ${allowed_extention}) + echo -en "materials: ${allowed_extention} : ${totalfileswc}..." + fn_print_ok_eol_nl + totalfileswc=0 + done + fi # Models - fn_print_dots "Copying models..." - fn_script_log "Copying models" - sleep 1 - mkdir "${fastdldir}/models" - find "${systemdir}/models" -name '*.vtx' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.vvd' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.mdl' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.phy' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.jpg' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.png' -exec cp {} "${fastdldir}/models" \; - fn_print_ok "Models copied" - sleep 0.5 - echo -en "\n" + if [ -d "${systemdir}/models" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) + for allowed_extention in "${allowed_extentions_array[@]}" + do + while read -r modelfile; do + ((totalfileswc++)) + echo -en "models: ${allowed_extention} : ${totalfileswc}..." $'\r' + sleep 0.01 + echo "${modelfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find "${systemdir}/materials" -type f -iname ${allowed_extention}) + echo -en "models: ${allowed_extention} : ${totalfileswc}..." + fn_print_ok_eol_nl + totalfileswc=0 + done + fi # Particles - fn_print_dots "Copying particles..." - fn_script_log "Copying particles" - sleep 0.5 - mkdir "${fastdldir}/particles" - find "${systemdir}" -name '*.pcf' -exec cp {} "${fastdldir}/particles" \; - fn_print_ok "Particles copied" - sleep 0.5 - echo -en "\n" + if [ -d "${systemdir}/particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + for allowed_extention in "${allowed_extentions_array[@]}" + do + while read -r particlefile; do + ((totalfileswc++)) + echo -en "models: ${allowed_extention} : ${totalfileswc}..." $'\r' + sleep 0.01 + echo "${particlefile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find "${systemdir}/models" -type f -iname ${allowed_extention}) + echo -en "models: ${allowed_extention} : ${totalfileswc}..." + fn_print_ok_eol_nl + totalfileswc=0 + done + fi # Sounds - fn_print_dots "Copying sounds..." - fn_script_log "Copying sounds" - sleep 0.5 - mkdir "${fastdldir}/sound" - find "${systemdir}" -name '*.wav' -exec cp {} "${fastdldir}/sound" \; - find "${systemdir}" -name '*.mp3' -exec cp {} "${fastdldir}/sound" \; - find "${systemdir}" -name '*.ogg' -exec cp {} "${fastdldir}/sound" \; - fn_print_ok "Sounds copied" - sleep 0.5 - echo -en "\n" + if [ -d "${systemdir}/sounds" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) + for allowed_extention in "${allowed_extentions_array[@]}" + do + while read -r soundfile; do + ((totalfileswc++)) + echo -en "sounds: ${allowed_extention} : ${totalfileswc}..." $'\r' + sleep 0.01 + echo "${soundfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find "${systemdir}/models" -type f -iname ${allowed_extention}) + echo -en "sounds: ${allowed_extention} : ${totalfileswc}..." + fn_print_ok_eol_nl + totalfileswc=0 + done + fi + +if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + # Calculates total file size + while read dufile; do + filesize=$(du -b "${dufile}"| awk '{ print $1 }') + filesizetotal=$(( ${filesizetotal} + ${filesize} )) + done <"${tmpdir}/fastdl_files_to_compress.txt" +fi + +if [ -z "${copyflag}" ]; then + echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0) " + rm "${tmpdir}/fastdl_files_to_compress.txt" + if fn_prompt_yn "Continue?" Y; then + copyflag=1 + fn_fastdl_source + else + core_exit.sh + fi +else + fn_fastdl_bzip2 +fi } # Generate lua file that will force download any file into the FastDL directory @@ -387,59 +477,48 @@ fn_fastdl_gmod_lua_enforcer(){ } fn_fastdl_bzip2(){ - # Compressing using bzip2 if user said yes - echo "" - if [ ${bzip2enable} == "on" ]; then - fn_print_info "Have a break, this step could take a while..." - echo -en "\n" - echo "" - fn_print_dots "Compressing files using bzip2..." - fn_script_log "Compressing files using bzip2..." - # bzip2 all files that are not already compressed (keeping original files) - find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; - fn_print_ok "bzip2 compression done" - fn_script_log "bzip2 compression done" - sleep 1 - echo -en "\n" - # Clear non compressed FastDL files - if [ "${clearnonbzip2}" == "on" ]; then - fn_print_dots "Clearing original uncompressed FastDL files..." - sleep 1 - find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -exec rm {} \; - fn_print_ok "Cleared uncompressed FastDL files" - fn_script_log "Cleared uncompressed FastDL files." - fi - fi + while read -r filetocompress; do + echo -en "compressing ${filetocompress}..." + bzip2 "${filetocompress}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "creating web directory ${webdir}..." + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "creating web directory ${webdir}..." + fi + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) } fn_fastdl_completed(){ # Finished message - echo "" - fn_print_ok "FastDL created!" - fn_script_log "FastDL job done" - sleep 2 - echo -en "\n" - echo "" - fn_print_info_nl "Need more documentation?" - echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" - echo -en "\n" - if [ "$bzip2installed" == "0" ]; then - echo "By the way, you'd better install bzip2 and re-run this command!" - fi - echo "Credits: UltimateByte" + echo "FastDL files are located in:" + echo "${webdir}" + echo "FastDL completed" + fn_script_log "FastDL completed" } +# Only Source supports FastDL +if [ "${engine}" != "source" ]; then + fn_print_fatal "${gamename} does not support FastDL" + fn_script_log_fatal "${gamename} does not support FastDL" + core_exit.sh +fi + # Run functions -fn_check_bzip2 -fn_fastdl_init +fn_print_header +echo "More info: https://git.io/vyk9a" +echo "" fn_fastdl_config -fn_clear_old_fastdl + + if [ "${gamename}" == "Garry's Mod" ]; then fn_fastdl_gmod fn_fastdl_gmod_lua_enforcer else fn_fastdl_source fi -fn_fastdl_bzip2 fn_fastdl_completed core_exit.sh From c4d31412a482509b8a59acce2b34bbdd82a6981b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Feb 2017 21:20:28 +0000 Subject: [PATCH 065/102] Further improvements --- lgsm/functions/command_fastdl.sh | 140 ++++++++++++++++++++----------- 1 file changed, 89 insertions(+), 51 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 3a85ed788..76b9a4d69 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -308,7 +308,7 @@ fn_fastdl_source(){ # Maps if [ -d "${systemdir}/maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + local allowed_extentions_array_=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) for allowed_extention in "${allowed_extentions_array[@]}" do fileswc=0 @@ -349,32 +349,36 @@ fn_fastdl_source(){ local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) for allowed_extention in "${allowed_extentions_array[@]}" do - while read -r materialfile; do - ((totalfileswc++)) - echo -en "materials: ${allowed_extention} : ${totalfileswc}..." $'\r' - sleep 0.01 - echo "${materialfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fileswc=0 + tput sc + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering materials ${allowed_extention} : ${fileswc}..." + fi + while read -r mapfile; do + ((fileswc++)) + if [ -n "${copyflag}" ]; then + tput rc; tput el + printf "copying materials ${allowed_extention} : ${fileswc}..." + if [ ! -d "${fastdldir}/materials" ]; then + mkdir "${fastdldir}/materials" + fi + cp "${mapfile}" "${fastdldir}/materials" + else + tput rc; tput el + printf "gathering materials ${allowed_extention} : ${fileswc}..." + sleep 0.01 + echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fi done < <(find "${systemdir}/materials" -type f -iname ${allowed_extention}) - echo -en "materials: ${allowed_extention} : ${totalfileswc}..." - fn_print_ok_eol_nl - totalfileswc=0 - done - fi - # Models - if [ -d "${systemdir}/models" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) - for allowed_extention in "${allowed_extentions_array[@]}" - do - while read -r modelfile; do - ((totalfileswc++)) - echo -en "models: ${allowed_extention} : ${totalfileswc}..." $'\r' - sleep 0.01 - echo "${modelfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" - done < <(find "${systemdir}/materials" -type f -iname ${allowed_extention}) - echo -en "models: ${allowed_extention} : ${totalfileswc}..." - fn_print_ok_eol_nl - totalfileswc=0 + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering materials ${allowed_extention} : ${fileswc}..." + fi + if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + fn_print_ok_eol_nl + fi done fi @@ -383,15 +387,36 @@ fn_fastdl_source(){ local allowed_extentions_array=( "*.pcf" ) for allowed_extention in "${allowed_extentions_array[@]}" do - while read -r particlefile; do - ((totalfileswc++)) - echo -en "models: ${allowed_extention} : ${totalfileswc}..." $'\r' - sleep 0.01 - echo "${particlefile}" >> "${tmpdir}/fastdl_files_to_compress.txt" - done < <(find "${systemdir}/models" -type f -iname ${allowed_extention}) - echo -en "models: ${allowed_extention} : ${totalfileswc}..." - fn_print_ok_eol_nl - totalfileswc=0 + fileswc=0 + tput sc + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering particles ${allowed_extention} : ${fileswc}..." + fi + while read -r mapfile; do + ((fileswc++)) + if [ -n "${copyflag}" ]; then + tput rc; tput el + printf "copying particles ${allowed_extention} : ${fileswc}..." + if [ ! -d "${fastdldir}/particles" ]; then + mkdir "${fastdldir}/particles" + fi + cp "${mapfile}" "${fastdldir}/particles" + else + tput rc; tput el + printf "gathering particles ${allowed_extention} : ${fileswc}..." + sleep 0.01 + echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fi + done < <(find "${systemdir}/particles" -type f -iname ${allowed_extention}) + + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering particles ${allowed_extention} : ${fileswc}..." + fi + if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + fn_print_ok_eol_nl + fi done fi @@ -400,15 +425,36 @@ fn_fastdl_source(){ local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) for allowed_extention in "${allowed_extentions_array[@]}" do - while read -r soundfile; do - ((totalfileswc++)) - echo -en "sounds: ${allowed_extention} : ${totalfileswc}..." $'\r' - sleep 0.01 - echo "${soundfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" - done < <(find "${systemdir}/models" -type f -iname ${allowed_extention}) - echo -en "sounds: ${allowed_extention} : ${totalfileswc}..." - fn_print_ok_eol_nl - totalfileswc=0 + fileswc=0 + tput sc + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering sounds ${allowed_extention} : ${fileswc}..." + fi + while read -r mapfile; do + ((fileswc++)) + if [ -n "${copyflag}" ]; then + tput rc; tput el + printf "copying soundss ${allowed_extention} : ${fileswc}..." + if [ ! -d "${fastdldir}/sounds" ]; then + mkdir "${fastdldir}/sounds" + fi + cp "${mapfile}" "${fastdldir}/sounds" + else + tput rc; tput el + printf "gathering sounds ${allowed_extention} : ${fileswc}..." + sleep 0.01 + echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fi + done < <(find "${systemdir}/sounds" -type f -iname ${allowed_extention}) + + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering sounds ${allowed_extention} : ${fileswc}..." + fi + if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + fn_print_ok_eol_nl + fi done fi @@ -500,20 +546,12 @@ fn_fastdl_completed(){ fn_script_log "FastDL completed" } -# Only Source supports FastDL -if [ "${engine}" != "source" ]; then - fn_print_fatal "${gamename} does not support FastDL" - fn_script_log_fatal "${gamename} does not support FastDL" - core_exit.sh -fi - # Run functions fn_print_header echo "More info: https://git.io/vyk9a" echo "" fn_fastdl_config - if [ "${gamename}" == "Garry's Mod" ]; then fn_fastdl_gmod fn_fastdl_gmod_lua_enforcer From 96ac99b543c5148763a49b5757b2277f57a54e15 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 3 Mar 2017 17:35:53 +0000 Subject: [PATCH 066/102] merged copy code in to one --- lgsm/functions/command_fastdl.sh | 219 ++++++++----------------------- 1 file changed, 58 insertions(+), 161 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 76b9a4d69..6343e5ab7 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -306,179 +306,76 @@ fn_fastdl_source(){ fn_script_log "analyzing required files" fi - # Maps - if [ -d "${systemdir}/maps" ]; then - local allowed_extentions_array_=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) - for allowed_extention in "${allowed_extentions_array[@]}" - do - fileswc=0 - tput sc - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering maps ${allowed_extention} : ${fileswc}..." + local directorys_array_=( "maps" "materials" "particles" "sounds" "*.txt" ) + for directory in "${directorys_array[@]}" + do + if [ -d "${systemdir}/${directory}" ]; then + if [ "${directory}" == "maps" ]; then + local allowed_extentions_array_=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + elif [ "${directory}" == "sounds" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) fi - while read -r mapfile; do - ((fileswc++)) - if [ -n "${copyflag}" ]; then + for allowed_extention in "${allowed_extentions_array[@]}" + do + fileswc=0 + tput sc + if [ -z "${copyflag}" ]; then tput rc; tput el - printf "copying maps ${allowed_extention} : ${fileswc}..." - if [ ! -d "${fastdldir}/maps" ]; then - mkdir "${fastdldir}/maps" - fi - cp "${mapfile}" "${fastdldir}/maps" - else - tput rc; tput el - printf "gathering maps ${allowed_extention} : ${fileswc}..." - sleep 0.01 - echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." fi - done < <(find "${systemdir}/maps" -type f -iname ${allowed_extention}) - - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering maps ${allowed_extention} : ${fileswc}..." - fi - if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then - fn_print_ok_eol_nl - fi - done - fi - - # Materials - if [ -d "${systemdir}/materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) - for allowed_extention in "${allowed_extentions_array[@]}" - do - fileswc=0 - tput sc - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering materials ${allowed_extention} : ${fileswc}..." - fi - while read -r mapfile; do - ((fileswc++)) - if [ -n "${copyflag}" ]; then - tput rc; tput el - printf "copying materials ${allowed_extention} : ${fileswc}..." - if [ ! -d "${fastdldir}/materials" ]; then - mkdir "${fastdldir}/materials" + while read -r mapfile; do + ((fileswc++)) + if [ -n "${copyflag}" ]; then + tput rc; tput el + printf "copying ${directory} ${allowed_extention} : ${fileswc}..." + if [ ! -d "${fastdldir}/${directory}" ]; then + mkdir "${fastdldir}/${directory}" + fi + cp "${mapfile}" "${fastdldir}/${directory}" + else + tput rc; tput el + printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + sleep 0.01 + echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" fi - cp "${mapfile}" "${fastdldir}/materials" - else - tput rc; tput el - printf "gathering materials ${allowed_extention} : ${fileswc}..." - sleep 0.01 - echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" - fi - done < <(find "${systemdir}/materials" -type f -iname ${allowed_extention}) + done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention}) - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering materials ${allowed_extention} : ${fileswc}..." - fi - if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then - fn_print_ok_eol_nl - fi - done - fi - - # Particles - if [ -d "${systemdir}/particles" ]; then - local allowed_extentions_array=( "*.pcf" ) - for allowed_extention in "${allowed_extentions_array[@]}" - do - fileswc=0 - tput sc - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering particles ${allowed_extention} : ${fileswc}..." - fi - while read -r mapfile; do - ((fileswc++)) - if [ -n "${copyflag}" ]; then + if [ -z "${copyflag}" ]; then tput rc; tput el - printf "copying particles ${allowed_extention} : ${fileswc}..." - if [ ! -d "${fastdldir}/particles" ]; then - mkdir "${fastdldir}/particles" - fi - cp "${mapfile}" "${fastdldir}/particles" - else - tput rc; tput el - printf "gathering particles ${allowed_extention} : ${fileswc}..." - sleep 0.01 - echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." fi - done < <(find "${systemdir}/particles" -type f -iname ${allowed_extention}) - - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering particles ${allowed_extention} : ${fileswc}..." - fi - if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then - fn_print_ok_eol_nl - fi - done - fi - - # Sounds - if [ -d "${systemdir}/sounds" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) - for allowed_extention in "${allowed_extentions_array[@]}" - do - fileswc=0 - tput sc - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering sounds ${allowed_extention} : ${fileswc}..." - fi - while read -r mapfile; do - ((fileswc++)) - if [ -n "${copyflag}" ]; then - tput rc; tput el - printf "copying soundss ${allowed_extention} : ${fileswc}..." - if [ ! -d "${fastdldir}/sounds" ]; then - mkdir "${fastdldir}/sounds" - fi - cp "${mapfile}" "${fastdldir}/sounds" - else - tput rc; tput el - printf "gathering sounds ${allowed_extention} : ${fileswc}..." - sleep 0.01 - echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + fn_print_ok_eol_nl fi - done < <(find "${systemdir}/sounds" -type f -iname ${allowed_extention}) - - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering sounds ${allowed_extention} : ${fileswc}..." - fi - if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then - fn_print_ok_eol_nl - fi - done + done + fi + done + + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + # Calculates total file size + while read dufile; do + filesize=$(du -b "${dufile}"| awk '{ print $1 }') + filesizetotal=$(( ${filesizetotal} + ${filesize} )) + done <"${tmpdir}/fastdl_files_to_compress.txt" fi -if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") - # Calculates total file size - while read dufile; do - filesize=$(du -b "${dufile}"| awk '{ print $1 }') - filesizetotal=$(( ${filesizetotal} + ${filesize} )) - done <"${tmpdir}/fastdl_files_to_compress.txt" -fi - -if [ -z "${copyflag}" ]; then - echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0) " - rm "${tmpdir}/fastdl_files_to_compress.txt" - if fn_prompt_yn "Continue?" Y; then - copyflag=1 - fn_fastdl_source + if [ -z "${copyflag}" ]; then + echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0) " + rm "${tmpdir}/fastdl_files_to_compress.txt" + if fn_prompt_yn "Continue?" Y; then + copyflag=1 + fn_fastdl_source + else + core_exit.sh + fi else - core_exit.sh + fn_fastdl_bzip2 fi -else - fn_fastdl_bzip2 -fi } # Generate lua file that will force download any file into the FastDL directory From 91525dcbbf4cb235d1763b7573aadc25d1a7fd37 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 3 Mar 2017 17:37:26 +0000 Subject: [PATCH 067/102] added if --- lgsm/functions/command_fastdl.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 6343e5ab7..e2c787ce1 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -366,7 +366,9 @@ fn_fastdl_source(){ if [ -z "${copyflag}" ]; then echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0) " - rm "${tmpdir}/fastdl_files_to_compress.txt" + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + rm "${tmpdir}/fastdl_files_to_compress.txt" + fi if fn_prompt_yn "Continue?" Y; then copyflag=1 fn_fastdl_source From 7ffe904a0609d1611234a7055a591786bda48a05 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 3 Mar 2017 17:57:39 +0000 Subject: [PATCH 068/102] fixes for fn_fastdl_source --- lgsm/functions/command_fastdl.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index e2c787ce1..f0e09fd6d 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -306,12 +306,12 @@ fn_fastdl_source(){ fn_script_log "analyzing required files" fi - local directorys_array_=( "maps" "materials" "particles" "sounds" "*.txt" ) + local directorys_array=( "maps" "materials" "particles" "sounds" ) for directory in "${directorys_array[@]}" do if [ -d "${systemdir}/${directory}" ]; then if [ "${directory}" == "maps" ]; then - local allowed_extentions_array_=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) elif [ "${directory}" == "materials" ]; then local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) elif [ "${directory}" == "particles" ]; then @@ -366,9 +366,7 @@ fn_fastdl_source(){ if [ -z "${copyflag}" ]; then echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0) " - if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - rm "${tmpdir}/fastdl_files_to_compress.txt" - fi + rm "${tmpdir}/fastdl_files_to_compress.txt" if fn_prompt_yn "Continue?" Y; then copyflag=1 fn_fastdl_source From 0abbe793be1e9af03becc8509617e6b940cc4e06 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 3 Mar 2017 21:49:48 +0000 Subject: [PATCH 069/102] Getting gmod version up and running --- lgsm/functions/command_fastdl.sh | 225 ++++++++++++------------------- 1 file changed, 83 insertions(+), 142 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index f0e09fd6d..dc39a3792 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -23,17 +23,9 @@ luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" fn_check_bzip2(){ # Returns true if not installed if [ -z "$(command -v bzip2)" ]; then - bzip2installed="0" - fn_print_info "bzip2 is not installed! Install it to enable file compression" - fn_script_log_info "bzip2 is not installed. Install it to enable file compression." - fn_script_log_info "https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" - echo -en "\n" - sleep 1 - echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" - sleep 2 - echo "" - else - bzip2installed="1" + fn_print_fail "bzip2 is not installed" + fn_script_log_fatal "bzip2 is not installed" + core_exit.sh fi } @@ -56,9 +48,9 @@ fn_fastdl_config(){ # Garry's Mod Specific if [ "${gamename}" == "Garry's Mod" ]; then - # Prompt to clear addons dir from fastdl, can use unnecessary space or be required depending on addon's file structures + # Prompt to clear addons dir from fastdl, can use unnecessary space or not be required depending on addon's file structures fn_print_dots - if fn_prompt_yn "Clear addons dir from fastdl dir?" Y; then + if fn_prompt_yn "Clear addons directory from FastDL?" Y; then cleargmodaddons="on"; else cleargmodaddons="off"; @@ -125,111 +117,51 @@ fn_clear_old_fastdl(){ } fn_fastdl_gmod(){ - # Copy all needed files for FastDL - echo "" - fn_print_dots "Starting gathering all needed files" - fn_script_log "Starting gathering all needed files" - sleep 1 - echo -en "\n" - - # No choice to cd to the directory, as find can't then display relative directory - cd "${systemdir}" || exit - - # Map Files - fn_print_dots "Copying map files..." - fn_script_log "Copying map files" - sleep 0.5 - find . -name '*.bsp' | cpio --quiet -updm "${fastdldir}" - find . -name '*.ain' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Map files copied" - sleep 0.5 - echo -en "\n" - - # Materials - fn_print_dots "Copying materials..." - fn_script_log "Copying materials" - sleep 0.5 - find . -name '*.vtf' | cpio --quiet -updm "${fastdldir}" - find . -name '*.vmt' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Materials copied" - sleep 0.5 - echo -en "\n" - - # Models - fn_print_dots "Copying models..." - fn_script_log "Copying models" - sleep 1 - find . -name '*.vtx' | cpio --quiet -updm "${fastdldir}" - find . -name '*.vvd' | cpio --quiet -updm "${fastdldir}" - find . -name '*.mdl' | cpio --quiet -updm "${fastdldir}" - find . -name '*.phy' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Models copied" - sleep 0.5 - echo -en "\n" - - # Particles - fn_print_dots "Copying particles..." - fn_script_log "Copying particles" - sleep 0.5 - find . -name '*.pcf' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Particles copied" - sleep 0.5 - echo -en "\n" - - # Sounds - fn_print_dots "Copying sounds..." - fn_script_log "Copying sounds" - sleep 0.5 - find . -name '*.wav' | cpio --quiet -updm "${fastdldir}" - find . -name '*.mp3' | cpio --quiet -updm "${fastdldir}" - find . -name '*.ogg' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Sounds copied" - sleep 0.5 - echo -en "\n" - - # Resources (mostly fonts) - fn_print_dots "Copying fonts and png..." - fn_script_log "Copying fonts and png" - sleep 1 - find . -name '*.otf' | cpio --quiet -updm "${fastdldir}" - find . -name '*.ttf' | cpio --quiet -updm "${fastdldir}" - find . -name '*.png' | cpio --quiet -updm "${fastdldir}" - fn_print_ok "Fonts and png copied" - sleep 0.5 - echo -en "\n" - - # Going back to rootdir in order to prevent mistakes - cd "${rootdir}" - # Correct addons directory structure for FastDL if [ -d "${fastdldir}/addons" ]; then - fn_print_info "Adjusting addons' file structure" - fn_script_log "Adjusting addons' file structure" - sleep 1 + echo -en "updating addons file structure..." cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" - fn_print_ok "Adjusted addons' file structure" - sleep 1 - echo -en "\n" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "updating addons file structure" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "updating addons file structure" + fi # Clear addons directory in fastdl if [ "${cleargmodaddons}" == "on" ]; then - fn_print_info "Clearing addons dir from fastdl dir" - fn_script_log "Clearing addons dir from fastdl dir" + echo -en "clearing addons dir from fastdl dir" + fn_script_log "clearing addons dir from fastdl dir..." sleep 1 rm -R "${fastdldir:?}/addons" - fn_print_ok "Cleared addons dir from fastdl dir" - sleep 1 - echo -en "\n" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "clearing addons dir from fastdl dir" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "clearing addons dir from fastdl dir" + fi fi fi # Correct content that may be into a lua directory by mistake like some darkrpmodification addons if [ -d "${fastdldir}/lua" ]; then - fn_print_dots "Typical DarkRP files detected, fixing" + echo -en "correcting DarkRP files..." sleep 2 cp -Rf "${fastdldir}/lua/"* "${fastdldir}" - fn_print_ok "Stupid DarkRP file structure fixed" - sleep 2 - echo -en "\n" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "correcting DarkRP files" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "correcting DarkRP files" + fi fi } @@ -310,14 +242,30 @@ fn_fastdl_source(){ for directory in "${directorys_array[@]}" do if [ -d "${systemdir}/${directory}" ]; then - if [ "${directory}" == "maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) - elif [ "${directory}" == "materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) - elif [ "${directory}" == "particles" ]; then - local allowed_extentions_array=( "*.pcf" ) - elif [ "${directory}" == "sounds" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) + if [ "${gamename}" == "Garry's Mod" ]; then + if [ "${directory}" == "maps" ]; then + local allowed_extentions_array=( "*.bsp" "*.ain" ) + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" ) + elif [ "${directory}" == "models" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" ) + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + elif [ "${directory}" == "sounds" ]; then + local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + elif [ "${directory}" == "resources" ]; then + local allowed_extentions_array=( "*.otf" "*.ttf" "*.png" ) + fi + else + if [ "${directory}" == "maps" ]; then + local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + elif [ "${directory}" == "sounds" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) + fi fi for allowed_extention in "${allowed_extentions_array[@]}" do @@ -381,41 +329,36 @@ fn_fastdl_source(){ # Generate lua file that will force download any file into the FastDL directory fn_fastdl_gmod_lua_enforcer(){ # Remove lua file if luaressource is turned off and file exists - echo "" - if [ "${luaressource}" == "off" ]; then - if [ -f "${luafastdlfullpath}" ]; then - fn_print_dots "Removing download enforcer" - sleep 1 - rm -R "${luafastdlfullpath:?}" - fn_print_ok "Removed download enforcer" - fn_script_log "Removed old download inforcer" - echo -en "\n" - sleep 2 + if [ -f "${luafastdlfullpath}" ]; then + echo -en "removing existing download enforcer..." + rm -R "${luafastdlfullpath:?}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "removing existing download enforcer" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "removing existing download enforcer" fi fi # Remove old lua file and generate a new one if user said yes if [ "${luaressource}" == "on" ]; then - if [ -f "${luafastdlfullpath}" ]; then - fn_print_dots "Removing old download enforcer" - sleep 1 - rm "${luafastdlfullpath}" - fn_print_ok "Removed old download enforcer" - fn_script_log "Removed old download enforcer" - echo -en "\n" - sleep 1 - fi - fn_print_dots "Generating new download enforcer" - fn_script_log "Generating new download enforcer" - sleep 1 + echo -en "creating new download enforcer..." + fn_script_log "creating new download enforcer" # Read all filenames and put them into a lua file at the right path find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}" done - fn_print_ok "Download enforcer generated" - fn_script_log "Download enforcer generated" - echo -en "\n" - echo "" - sleep 2 + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "creating new download enforcer" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "creating new download enforcer" + fi fi } @@ -448,12 +391,10 @@ fn_print_header echo "More info: https://git.io/vyk9a" echo "" fn_fastdl_config - +fn_fastdl_source if [ "${gamename}" == "Garry's Mod" ]; then fn_fastdl_gmod fn_fastdl_gmod_lua_enforcer -else - fn_fastdl_source fi fn_fastdl_completed core_exit.sh From a4f634dc034d368caefaafe529aeed46038f914f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 3 Mar 2017 22:39:10 +0000 Subject: [PATCH 070/102] Further improvements downlaod enforcer currently broken --- lgsm/functions/command_fastdl.sh | 69 ++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index dc39a3792..7179484cd 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -40,28 +40,30 @@ fn_fastdl_config(){ echo "${fastdldir}" echo "" if fn_prompt_yn "Overwrite existing directory?" Y; then - clearoldfastdl="on" + fn_script_log_info "Overwrite existing directory: YES" else - clearoldfastdl="off" + core_exit.sh fi fi # Garry's Mod Specific if [ "${gamename}" == "Garry's Mod" ]; then # Prompt to clear addons dir from fastdl, can use unnecessary space or not be required depending on addon's file structures - fn_print_dots if fn_prompt_yn "Clear addons directory from FastDL?" Y; then cleargmodaddons="on"; + fn_script_log_info "Clear addons directory from FastDL: YES" else cleargmodaddons="off"; + fn_script_log_info "Clear addons directory from FastDL: NO" fi # Prompt for download enforcer, which is using a .lua addfile resource generator - fn_print_dots if fn_prompt_yn "Use client download enforcer?" Y; then luaressource="on" + fn_script_log_info "Use client download enforcer: YES" else luaressource="off" + fn_script_log_info "Use client download enforcer: NO" fi fi } @@ -74,11 +76,11 @@ fn_fastdl_dirs(){ exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "creating web directory ${webdir}..." + fn_script_log_fatal "Creating web directory ${webdir}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "creating web directory ${webdir}..." + fn_script_log_pass "Creating web directory ${webdir}" fi sleep 0.5 fi @@ -88,11 +90,11 @@ fn_fastdl_dirs(){ exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "creating fastdl directory ${fastdldir}..." + fn_script_log_fatal "Creating fastdl directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "creating fastdl directory ${fastdldir}..." + fn_script_log_pass "Creating fastdl directory ${fastdldir}" fi sleep 0.5 fi @@ -106,11 +108,11 @@ fn_clear_old_fastdl(){ exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "clearing existing FastDL directory ${fastdldir}..." + fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "clearing existing FastDL directory ${fastdldir}..." + fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" fi sleep 0.5 fi @@ -133,7 +135,6 @@ fn_fastdl_gmod(){ # Clear addons directory in fastdl if [ "${cleargmodaddons}" == "on" ]; then echo -en "clearing addons dir from fastdl dir" - fn_script_log "clearing addons dir from fastdl dir..." sleep 1 rm -R "${fastdldir:?}/addons" exitcode=$? @@ -147,7 +148,6 @@ fn_fastdl_gmod(){ fi fi fi - # Correct content that may be into a lua directory by mistake like some darkrpmodification addons if [ -d "${fastdldir}/lua" ]; then echo -en "correcting DarkRP files..." @@ -229,13 +229,13 @@ fn_fastdl_source(){ fn_fastdl_dirs echo -e "copying files to ${fastdldir}" - fn_script_log "copying files to ${fastdldir}" + fn_script_log_info "Copying files to ${fastdldir}" else if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then rm -f "${tmpdir}/fastdl_files_to_compress.txt" fi - echo -e "analyzing required files" - fn_script_log "analyzing required files" + echo -e "analysing required files" + fn_script_log_info "Analysing required files" fi local directorys_array=( "maps" "materials" "particles" "sounds" ) @@ -273,17 +273,26 @@ fn_fastdl_source(){ tput sc if [ -z "${copyflag}" ]; then tput rc; tput el - printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + printf "copying ${directory} ${allowed_extention} : ${fileswc}..." fi while read -r mapfile; do ((fileswc++)) if [ -n "${copyflag}" ]; then tput rc; tput el printf "copying ${directory} ${allowed_extention} : ${fileswc}..." + sleep 0.01 if [ ! -d "${fastdldir}/${directory}" ]; then mkdir "${fastdldir}/${directory}" fi cp "${mapfile}" "${fastdldir}/${directory}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${mapfile} > ${fastdldir}/${directory}" + core_exit.sh + else + fn_script_log_pass "Copying ${mapfile} > ${fastdldir}/${directory}" + fi else tput rc; tput el printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." @@ -313,7 +322,8 @@ fn_fastdl_source(){ fi if [ -z "${copyflag}" ]; then - echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0) " + echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" rm "${tmpdir}/fastdl_files_to_compress.txt" if fn_prompt_yn "Continue?" Y; then copyflag=1 @@ -322,6 +332,9 @@ fn_fastdl_source(){ core_exit.sh fi else + if [ "${gamename}" == "Garry's Mod" ]; then + fn_fastdl_gmod_lua_enforcer + fi fn_fastdl_bzip2 fi } @@ -330,34 +343,33 @@ fn_fastdl_source(){ fn_fastdl_gmod_lua_enforcer(){ # Remove lua file if luaressource is turned off and file exists if [ -f "${luafastdlfullpath}" ]; then - echo -en "removing existing download enforcer..." + echo -en "removing existing download enforcer: ${luafastdlfile}..." rm -R "${luafastdlfullpath:?}" exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "removing existing download enforcer" + fn_script_log_fatal "removing existing download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "removing existing download enforcer" + fn_script_log_pass "removing existing download enforcer ${luafastdlfullpath}" fi fi # Remove old lua file and generate a new one if user said yes if [ "${luaressource}" == "on" ]; then - echo -en "creating new download enforcer..." - fn_script_log "creating new download enforcer" + echo -en "creating new download enforcer: ${luafastdlfile}..." # Read all filenames and put them into a lua file at the right path - find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do + find "${fastdldir:?}" \( -type f -name "*.bz2" \) -printf '%P\n' | while read line; do echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}" done exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "creating new download enforcer" + fn_script_log_fatal "creating new download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "creating new download enforcer" + fn_script_log_pass "creating new download enforcer ${luafastdlfullpath}" fi fi } @@ -369,11 +381,11 @@ fn_fastdl_bzip2(){ exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "creating web directory ${webdir}..." + fn_script_log_fatal "compressing ${filetocompress}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "creating web directory ${webdir}..." + fn_script_log_pass "compressing ${filetocompress}" fi done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) } @@ -383,7 +395,7 @@ fn_fastdl_completed(){ echo "FastDL files are located in:" echo "${webdir}" echo "FastDL completed" - fn_script_log "FastDL completed" + fn_script_log_info "FastDL completed" } # Run functions @@ -394,7 +406,6 @@ fn_fastdl_config fn_fastdl_source if [ "${gamename}" == "Garry's Mod" ]; then fn_fastdl_gmod - fn_fastdl_gmod_lua_enforcer fi fn_fastdl_completed core_exit.sh From 6a474dc6ad139441caeda2c6d92baf820d0fa606 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 4 Mar 2017 05:17:09 +0100 Subject: [PATCH 071/102] core_exit.sh --- lgsm/functions/command_dev_detect_deps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index f709a4603..42ea13880 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -148,4 +148,6 @@ rm -f "${tmpdir}/.depdetect_ubuntu_list_uniq" rm -f "${tmpdir}/.depdetect_readelf" rm -f "${tmpdir}/.depdetect_unknown" -rm -f "${tmpdir}/.depdetect_unknown_uniq" \ No newline at end of file +rm -f "${tmpdir}/.depdetect_unknown_uniq" + +core_exit.sh From 7660f3a874e5c543e35bb510b4edf7af668efde3 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 4 Mar 2017 05:17:09 +0100 Subject: [PATCH 072/102] core_exit.sh --- lgsm/functions/command_dev_detect_glibc.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh index 7703fba34..536a12c2a 100644 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -37,4 +37,6 @@ while IFS= read -r -d $'\0' line; do done echo "" cat "${tmpdir}/detect_glibc.tmp"|sort|uniq|sort -r --version-sort -rm "${tmpdir}/detect_glibc.tmp" \ No newline at end of file +rm "${tmpdir}/detect_glibc.tmp" + +core_exit.sh From 7fe986a6876d2a9980e3be5690064f50b3600493 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 4 Mar 2017 05:17:10 +0100 Subject: [PATCH 073/102] core_exit.sh --- lgsm/functions/command_dev_detect_ldd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh index 16f1f9473..4e1c7b2b3 100644 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -50,4 +50,6 @@ echo "=================================" cat "${tmpdir}/detect_ldd_not_found.tmp" rm "${tmpdir}/detect_ldd.tmp" -rm "${tmpdir}/detect_ldd_not_found.tmp" \ No newline at end of file +rm "${tmpdir}/detect_ldd_not_found.tmp" + +core_exit.sh From e51746e5b117fbb9da938c8ad84f0ffef41994c8 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 4 Mar 2017 05:33:47 +0100 Subject: [PATCH 074/102] proper exit (fix opt running after uf) --- lgsm/functions/core_getopt.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 39efa37e4..d658397e2 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -174,12 +174,11 @@ for i in "${optcommands[@]}"; do if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command ${currentopt[index+1]} + core_exit.sh break fi done done - break - core_exit.sh fi done @@ -187,4 +186,4 @@ done echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 fn_opt_usage -core_exit.sh \ No newline at end of file +core_exit.sh From 1c06996cff4036a838b507ee5a581e9180646be4 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 4 Mar 2017 05:42:19 +0100 Subject: [PATCH 075/102] attempt to fix lua enforcer --- lgsm/functions/command_fastdl.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 7179484cd..60c78fa18 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -341,10 +341,10 @@ fn_fastdl_source(){ # Generate lua file that will force download any file into the FastDL directory fn_fastdl_gmod_lua_enforcer(){ - # Remove lua file if luaressource is turned off and file exists + # Clear old lua file if [ -f "${luafastdlfullpath}" ]; then echo -en "removing existing download enforcer: ${luafastdlfile}..." - rm -R "${luafastdlfullpath:?}" + rm "${luafastdlfullpath:?}" exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl @@ -355,9 +355,10 @@ fn_fastdl_gmod_lua_enforcer(){ fn_script_log_pass "removing existing download enforcer ${luafastdlfullpath}" fi fi - # Remove old lua file and generate a new one if user said yes + # Generate new one if user said yes if [ "${luaressource}" == "on" ]; then echo -en "creating new download enforcer: ${luafastdlfile}..." + touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path find "${fastdldir:?}" \( -type f -name "*.bz2" \) -printf '%P\n' | while read line; do echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}" From 02b661adbb61fcd3896353804d9d586e0ee480d0 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sat, 4 Mar 2017 05:49:54 +0100 Subject: [PATCH 076/102] lua ressource not bz2 ! --- lgsm/functions/command_fastdl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 60c78fa18..3b695cf0e 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -360,7 +360,7 @@ fn_fastdl_gmod_lua_enforcer(){ echo -en "creating new download enforcer: ${luafastdlfile}..." touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path - find "${fastdldir:?}" \( -type f -name "*.bz2" \) -printf '%P\n' | while read line; do + find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}" done exitcode=$? From 394bfd59056a6a9db5f0d5a42abca09da7be8135 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 14:34:53 +0000 Subject: [PATCH 077/102] Added if statement for webdir allowing the user to change it Also added forgotten dirs for gmod --- lgsm/functions/command_fastdl.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 3b695cf0e..0c4766704 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -12,7 +12,9 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh # Directories -webdir="${rootdir}/public_html" +if [ -z "${webdir}" ]; then + webdir="${lgsmdir}/public_html" +fi fastdldir="${webdir}/fastdl" addonsdir="${systemdir}/addons" # Server lua autorun dir, used to autorun lua on client connect to the server @@ -238,7 +240,7 @@ fn_fastdl_source(){ fn_script_log_info "Analysing required files" fi - local directorys_array=( "maps" "materials" "particles" "sounds" ) + local directorys_array=( "maps" "materials" "models" "particles" "sounds" "resources" ) for directory in "${directorys_array[@]}" do if [ -d "${systemdir}/${directory}" ]; then From 1e81f72b66b2040dd9cb60ccb64f48305a625df2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 14:38:01 +0000 Subject: [PATCH 078/102] Reverted to master version of fastdl to allow merging to develop fast dl is being worked on in ultimatebyte-0220 --- lgsm/functions/command_fastdl.sh | 230 +++++++------------------------ 1 file changed, 53 insertions(+), 177 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 3d39f49ea..9fe7ca68b 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -6,18 +6,11 @@ # Description: Creates a FastDL directory. local commandname="FASTDL" -local commandaction="FastDL Generator" +local commandaction="FastDL" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh -# Only Source supports FastDL -if [ "${engine}" != "source" ]; then - fn_print_error "${gamename} does not support FastDL" - fn_script_log_error "${gamename} does not support FastDL" - core_exit.sh -fi - # Directories webdir="${rootdir}/public_html" fastdldir="${webdir}/fastdl" @@ -31,27 +24,25 @@ fn_check_bzip2(){ # Returns true if not installed if [ -z "$(command -v bzip2)" ]; then bzip2installed="0" - fn_print_info "bzip2 is not installed! Install it to enable file compression" - fn_script_log_info "bzip2 is not installed. Install it to enable file compression." - fn_script_log_info "https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" + fn_print_info "bzip2 is not installed !" + fn_script_log_info "bzip2 is not installed" echo -en "\n" sleep 1 - echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" + echo "We advise using it" + echo "For more information, see https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" sleep 2 - echo "" else bzip2installed="1" fi } -# Initiates FastDL fn_fastdl_init(){ - fn_print_header - fn_script_log "Started FastDL Generator" - sleep 1 - fn_check_bzip2 # User confirmation - if ! fn_prompt_yn "Build FastDL directory?" Y; then + fn_print_ok "Welcome to LGSM's FastDL generator" + sleep 1 + echo -en "\n" + fn_script_log "Started FastDL creation" + if ! fn_prompt_yn "Continue?" Y; then exit fi fn_script_log "Initiating FastDL creation" @@ -72,30 +63,28 @@ fn_fastdl_init(){ fi if [ ! -d "${fastdldir}" ]; then # No directory, won't ask for removing old ones - newfastdl="true" + newfastdl=1 fn_print_dots "Creating fastdl directory" sleep 0.5 mkdir "${fastdldir}" fn_print_ok "Created fastdl directory" - fn_script_log "Created fastdl directory" + fn_script_log "FastDL created fastdl directory" sleep 1 echo -en "\n" clearoldfastdl="off" # Nothing to clear elif [ "$(ls -A "${fastdldir}")" ]; then - newfastdl="false" - else - newfastdl="true" + newfastdl=0 fi } -# Prompts user for FastDL creation settings fn_fastdl_config(){ + # Global settings for FastDL creation fn_print_info "Entering configuration" fn_script_log "Configuration" sleep 2 echo -en "\n" # Prompt for clearing old files if directory was already here - if [ "${newfastdl}" == "false" ]; then + if [ -n "${newfastdl}" ] && [ "${newfastdl}" == "0" ]; then fn_print_dots if fn_prompt_yn "Clear old FastDL files?" Y; then clearoldfastdl="on"; fn_script_log "clearoldfastdl enabled"; fn_print_ok "Clearing Enabled" @@ -104,50 +93,27 @@ fn_fastdl_config(){ fi echo -en "\n" fi - # Settings for bzip2 users + # Prompt for using bzip2 if it's installed if [ ${bzip2installed} == 1 ]; then - # Prompt for using bzip2 if it's installed fn_print_dots - if fn_prompt_yn "Enable bzip2 file compression?" Y; then + if fn_prompt_yn "Enable file compression using bzip2?" Y; then bzip2enable="on"; fn_script_log "bzip2 enabled"; fn_print_ok "bzip2 Enabled" else bzip2enable="off"; fn_script_log "bzip2 disabled"; fn_print_ok "bzip2 Disabled" fi echo -en "\n" - if [ "${gamename}" == "Garry's Mod" ]&&[ "${bzip2enable}" == "on" ]; then - # Prompt for clearing uncompressed files, can save some space but might cause issues for gmod - fn_print_dots - if fn_prompt_yn "Clear non-bzip2 FastDL files?" Y; then - clearnonbzip2="on"; fn_script_log "Clearing non-bzip2 files Enabled."; fn_print_ok "Clearing non-bzip2 files Enabled" - else - clearnonbzip2="off"; fn_script_log "Clearing non-bzip2 files Disabled."; fn_print_ok "Clearing non-bzip2 files Disabled" - fi - echo -en "\n" - else - # Other games default remove non bzip2 files - clearnonbzip2="on" - fn_script_log "Original uncompressed fastDL files won't be kept." - fi fi - # Garry's Mod Specific - if [ "${gamename}" == "Garry's Mod" ]; then - # Prompt to clear addons dir from fastdl, can use unnecessary space or be required depending on addon's file structures - fn_print_dots - if fn_prompt_yn "Clear addons dir from fastdl dir?" Y; then - cleargmodaddons="on"; fn_script_log "Addons clearing Enabled."; fn_print_ok "Addons clearing Enabled" - else - cleargmodaddons="off"; fn_script_log "Addons clearing Disabled."; fn_print_ok "Addons clearing Disabled" - fi - echo -en "\n" - # Prompt for download enforcer, which is using a .lua addfile resource generator - fn_print_dots - if fn_prompt_yn "Use client download enforcer?" Y; then - luaressource="on"; fn_script_log "DL enforcer Enabled."; fn_print_ok "Enforcer Enabled" - else - luaressource="off"; fn_script_log "DL enforcer Disabled."; fn_print_ok "Enforcer Disabled" - fi - echo -en "\n" +} + +fn_fastdl_gmod_config(){ + # Prompt for download enforcer, that is using a .lua addfile resource generator + fn_print_dots + if fn_prompt_yn "Use client download enforcer?" Y; then + luaressource="on"; fn_script_log "DL enforcer Enabled"; fn_print_ok "Enforcer Enabled" + else + luaressource="off"; fn_script_log "DL enforcer Disabled"; fn_print_ok "Enforcer Disabled" fi + echo -en "\n" } fn_clear_old_fastdl(){ @@ -164,7 +130,7 @@ fn_clear_old_fastdl(){ fi } -fn_fastdl_gmod(){ +fn_gmod_fastdl(){ # Copy all needed files for FastDL echo "" fn_print_dots "Starting gathering all needed files" @@ -173,7 +139,7 @@ fn_fastdl_gmod(){ echo -en "\n" # No choice to cd to the directory, as find can't then display relative directory - cd "${systemdir}" || exit + cd "${systemdir}" # Map Files fn_print_dots "Copying map files..." @@ -244,27 +210,18 @@ fn_fastdl_gmod(){ # Correct addons directory structure for FastDL if [ -d "${fastdldir}/addons" ]; then fn_print_info "Adjusting addons' file structure" - fn_script_log "Adjusting addons' file structure" + fn_script_log "Adjusting addon's file structure" sleep 1 cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" - fn_print_ok "Adjusted addons' file structure" + #Don't remove yet rm -R "${fastdldir:?}/addons" + fn_print_ok "Adjusted addon's file structure" sleep 1 echo -en "\n" - # Clear addons directory in fastdl - if [ "${cleargmodaddons}" == "on" ]; then - fn_print_info "Clearing addons dir from fastdl dir" - fn_script_log "Clearing addons dir from fastdl dir" - sleep 1 - rm -R "${fastdldir:?}/addons" - fn_print_ok "Cleared addons dir from fastdl dir" - sleep 1 - echo -en "\n" - fi fi # Correct content that may be into a lua directory by mistake like some darkrpmodification addons if [ -d "${fastdldir}/lua" ]; then - fn_print_dots "Typical DarkRP files detected, fixing" + fn_print_dots "Typical DarkRP shit detected, fixing" sleep 2 cp -Rf "${fastdldir}/lua/"* "${fastdldir}" fn_print_ok "Stupid DarkRP file structure fixed" @@ -273,80 +230,8 @@ fn_fastdl_gmod(){ fi } -fn_fastdl_source(){ - # Copy all needed files for FastDL - echo "" - fn_print_dots "Starting gathering all needed files" - fn_script_log "Starting gathering all needed files" - sleep 1 - echo -en "\n" - - # Map Files - fn_print_dots "Copying map files..." - fn_script_log "Copying map files" - sleep 0.5 - mkdir "${fastdldir}/maps" - find "${systemdir}/maps" -name '*.bsp' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.ain' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.nav' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.jpg' -exec cp {} "${fastdldir}/maps" \; - find "${systemdir}/maps" -name '*.txt' -exec cp {} "${fastdldir}/maps" \; - fn_print_ok "Map files copied" - sleep 0.5 - echo -en "\n" - - # Materials - fn_print_dots "Copying materials..." - fn_script_log "Copying materials" - sleep 0.5 - mkdir "${fastdldir}/materials" - find "${systemdir}/materials" -name '*.vtf' -exec cp {} "${fastdldir}/materials" \; - find "${systemdir}/materials" -name '*.vmt' -exec cp {} "${fastdldir}/materials" \; - find "${systemdir}/materials" -name '*.vbf' -exec cp {} "${fastdldir}/materials" \; - fn_print_ok "Materials copied" - sleep 0.5 - echo -en "\n" - - # Models - fn_print_dots "Copying models..." - fn_script_log "Copying models" - sleep 1 - mkdir "${fastdldir}/models" - find "${systemdir}/models" -name '*.vtx' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.vvd' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.mdl' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.phy' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.jpg' -exec cp {} "${fastdldir}/models" \; - find "${systemdir}/models" -name '*.png' -exec cp {} "${fastdldir}/models" \; - fn_print_ok "Models copied" - sleep 0.5 - echo -en "\n" - - # Particles - fn_print_dots "Copying particles..." - fn_script_log "Copying particles" - sleep 0.5 - mkdir "${fastdldir}/particles" - find "${systemdir}" -name '*.pcf' -exec cp {} "${fastdldir}/particles" \; - fn_print_ok "Particles copied" - sleep 0.5 - echo -en "\n" - - # Sounds - fn_print_dots "Copying sounds..." - fn_script_log "Copying sounds" - sleep 0.5 - mkdir "${fastdldir}/sound" - find "${systemdir}" -name '*.wav' -exec cp {} "${fastdldir}/sound" \; - find "${systemdir}" -name '*.mp3' -exec cp {} "${fastdldir}/sound" \; - find "${systemdir}" -name '*.ogg' -exec cp {} "${fastdldir}/sound" \; - fn_print_ok "Sounds copied" - sleep 0.5 - echo -en "\n" -} - # Generate lua file that will force download any file into the FastDL directory -fn_fastdl_gmod_lua_enforcer(){ +fn_lua_fastdl(){ # Remove lua file if luaressource is turned off and file exists echo "" if [ "${luaressource}" == "off" ]; then @@ -375,8 +260,8 @@ fn_fastdl_gmod_lua_enforcer(){ fn_script_log "Generating new download enforcer" sleep 1 # Read all filenames and put them into a lua file at the right path - find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do - echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}" + find "${fastdldir}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do + echo "resource.AddFile( "\""${line}"\"" )" >> ${luafastdlfullpath} done fn_print_ok "Download enforcer generated" fn_script_log "Download enforcer generated" @@ -396,50 +281,41 @@ fn_fastdl_bzip2(){ fn_print_dots "Compressing files using bzip2..." fn_script_log "Compressing files using bzip2..." # bzip2 all files that are not already compressed (keeping original files) - find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; + find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; fn_print_ok "bzip2 compression done" fn_script_log "bzip2 compression done" sleep 1 echo -en "\n" - # Clear non compressed FastDL files - if [ "${clearnonbzip2}" == "on" ]; then - fn_print_dots "Clearing original uncompressed FastDL files..." - sleep 1 - find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -exec rm {} \; - fn_print_ok "Cleared uncompressed FastDL files" - fn_script_log "Cleared uncompressed FastDL files." - fi fi } fn_fastdl_completed(){ # Finished message echo "" - fn_print_ok "FastDL created!" + fn_print_ok "Congratulations, it's done!" fn_script_log "FastDL job done" sleep 2 echo -en "\n" echo "" - fn_print_info_nl "Need more documentation?" - echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" + fn_print_info "Need more documentation? See https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" echo -en "\n" if [ "$bzip2installed" == "0" ]; then - echo "By the way, you'd better install bzip2 and re-run this command!" + echo "By the way, you'd better install bzip2 and re-run this command!" fi - echo "Credits: UltimateByte" + echo "Credits : UltimateByte" } -# Run functions -fn_check_bzip2 -fn_fastdl_init -fn_fastdl_config -fn_clear_old_fastdl +# Game checking and functions running +# Garry's Mod if [ "${gamename}" == "Garry's Mod" ]; then - fn_fastdl_gmod - fn_fastdl_gmod_lua_enforcer -else - fn_fastdl_source + fn_check_bzip2 + fn_fastdl_init + fn_fastdl_config + fn_fastdl_gmod_config + fn_clear_old_fastdl + fn_gmod_fastdl + fn_lua_fastdl + fn_fastdl_bzip2 + fn_fastdl_completed + exit fi -fn_fastdl_bzip2 -fn_fastdl_completed -core_exit.sh From f013f96c4ebe97f0a07f807906dab5b188e1e77d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 14:39:57 +0000 Subject: [PATCH 079/102] Also reverted getopt as well being worked on in ultimatebyte-0220 branch --- lgsm/functions/core_getopt.sh | 1100 ++++++++++++++++++++++++++++----- 1 file changed, 954 insertions(+), 146 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 78b097398..bcecc6c2d 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -6,169 +6,977 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -### Define all commands here ### -## User commands | Trigger commands | Description -# Standard commands -cmd_install=( "i;install" "command_install.sh" "Install the server." ) -cmd_auto_install=( "ai;auto-install" "command_autoinstall.sh" "Install the server without prompts." ) -cmd_start=( "st;start" "command_start.sh" "Start the server." ) -cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) -cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) -cmd_details=( "dt;details" "command_details.sh" "Display relevant server information." ) -cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post stripped details to pastebin for support." ) -cmd_backup=( "b;backup" "command_backup.sh" "Create archives of the server." ) -cmd_update_functions=( "uf;update-functions" "command_update_functions.sh" "Update LinuxGSM functions." ) -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 it if crashed." ) -# 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." ) -# Update servers only -cmd_update=( "u;update" "command_update.sh" "Check for updates and apply if available." ) -cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Unconditionally update the server." ) -# SteamCMD servers only -cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) -# Server with mods-install -cmd_mods_install=( "mi;mods-install" "command_mods_install.sh" "View and install available mods/addons." ) -cmd_mods_remove=( "mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon." ) -cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mods/addons." ) -# Server specific -cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) -cmd_install_default_ressources=( "ir;install-default-ressources" "command_install_resources_mta.sh" "Install the MTA default resources." ) -cmd_wipe=( "wi;wipe" "command_wipe.sh" "Wipe your server data." ) -cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) -cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) -cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) -cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) -cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) -# Dev commands -cmd_dev_debug=( "dev;dev-debug" "command_dev_debug.sh" "DEVCOMMAND" ) -cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "DEVCOMMAND" ) -cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "DEVCOMMAND" ) -cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "DEVCOMMAND" ) - -### Set specific opt here ### - -## Common opt to all servers - -currentopt=( "${cmd_install[@]}" "${cmd_auto_install[@]}" "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_details[@]}" ) -currentopt+=( "${cmd_backup[@]}" "${cmd_update_functions[@]}" "${cmd_test_alert[@]}" "${cmd_monitor[@]}" ) - -## Servers that do not have a feature - -# Exclude games without a console -if [ "${gamename}" != "TeamSpeak 3" ]; then - currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) -fi -# Exclude noupdated games here -if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${gamename}" != "Call of Duty" ]&&[ "${gamename}" != "Call of Duty: United Offensive" ]&&[ "${gamename}" != "Call of Duty 2" ]&&[ "${gamename}" != "Call of Duty 4" ]&&[ "${gamename}" != "Call of Duty: World at War" ]&&[ "${gamename}" != "QuakeWorld" ]&&[ "${gamename}" != "Quake 2" ]&&[ "${gamename}" != "Quake 3: Arena" ]&&[ "${gamename}" != "Wolfenstein: Enemy Territory" ]; then - currentopt+=( "${cmd_update[@]}" "${cmd_force_update[@]}") -fi +fn_getopt_generic(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + fu|force-update|update-restart) + forceupdate=1; + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + v|validate) + command_validate.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + mi|mods-install) + command_mods_install.sh;; + mu|mods-update) + command_mods_update.sh;; + mr|mods-remove) + command_mods_remove.sh;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." + echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}mods-install\t${default}mi |View and install available mods/addons." + echo -e "${blue}mods-update\t${default}mu |Update installed mods/addons." + echo -e "${blue}mods-remove\t${default}mr |Remove installed mods/addons." + } | column -s $'\t' -t + esac +} -## Include games that have access to specific commands -# Validate command -if [ -n "${appid}" ]; then - currentopt+=( "${cmd_validate[@]}" ) -fi -# FastDL command -if [ "${engine}" == "source" ]; then - currentopt+=( "${cmd_fastdl[@]}" ) -fi -# Wipe command -if [ "${gamename}" == "Rust" ]; then - currentopt+=( "${cmd_wipe[@]}" ) -fi -# Mods commands -if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]|[ "${gamename}" == "Hurtworld" ]|[ "${gamename}" == "7 Days To Die" ]; then - currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) -fi +fn_getopt_generic_update_no_steam(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + } | column -s $'\t' -t + esac +} -## Game server exclusive commands -# TeamSpeak exclusive -if [ "${gamename}" == "TeamSpeak 3" ]; then - currentopt+=( "${cmd_change_password[@]}" ) -fi -# Unreal exclusive -if [ "${engine}" == "unreal2" ]; then - if [ "${gamename}" == "Unreal Tournament 2004" ]; then - currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) - else - currentopt+=( "${cmd_map_compressor_u2[@]}" ) +fn_getopt_generic_no_update(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 fi -fi -if [ "${engine}" == "unreal" ]; then - currentopt+=( "${cmd_map_compressor_u99[@]}" ) -fi -# DST exclusive -if [ "${gamename}" == "Don't Starve Together" ]; then - currentopt+=( "${cmd_install_dst_token[@]}" ) -fi -# MTA exclusive -if [ "${gamename}" == "Multi Theft Auto" ]; then - currentopt+=( "${cmd_install_default_ressources[@]}" ) -fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + } | column -s $'\t' -t + esac +} -## Developer commands -currentopt+=( "${cmd_dev_debug[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" ) +fn_getopt_teamspeak3(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + pw|change-password) + command_ts3_server_pass.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from teamspeak.com." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}change-password\t${default}pw |Changes TS3 serveradmin password." + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + } | column -s $'\t' -t + esac +} +fn_getopt_minecraft(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from mojang.com." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + } | column -s $'\t' -t + esac +} -### Build list of available commands -optcommands=() -index="0" -for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - cmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((cmdindex=1; cmdindex <= ${cmdamount}; cmdindex++)); do - optcommands+=( "$(echo "${currentopt[index]}"| awk -F ';' -v x=${cmdindex} '{ print $x }')" ) - done -done +fn_getopt_mta(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + fu|force-update|update-restart) + forceupdate=1; + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ir|install-default-resources) + command_install_resources_mta.sh;; + ai|auto-install) + fn_autoinstall;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from linux.mtasa.com." + echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from linux.mtasa.com." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}install-default-resources\t${default}ir |Install the MTA default resources." + } | column -s $'\t' -t + esac +} -# Shows LinuxGSM usage -fn_opt_usage(){ +fn_getopt_mumble(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + dev|dev-debug) + command_dev_debug.sh;; + c|console) + command_console.sh;; + i|install) + command_install.sh;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from GitHub." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + } | column -s $'\t' -t + esac +} + +fn_getopt_dstserver(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + fu|force-update|update-restart) + forceupdate=1; + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + v|validate) + command_validate.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + ct|cluster-token) + install_dst_token.sh;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" echo "${gamename} - Linux Game Server Manager - Version ${version}" echo "https://gameservermanagers.com/${selfname}" echo -e "" echo -e "${lightyellow}Commands${default}" - # Display available commands - index="0" { - for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - # Hide developer commands - if [ "${currentopt[index+2]}" != "DEVCOMMAND" ]; then - echo -e "${cyan}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index+2]}" - fi - done + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." + echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}cluster-token\t${default}ct |Configure cluster token." } | column -s $'\t' -t - core_exit.sh + esac } -### Check if user commands exist and run corresponding scripts, or display script usage -if [ -z "${getopt}" ]; then - fn_opt_usage -fi -# Command exists -for i in "${optcommands[@]}"; do - if [ "${i}" == "${getopt}" ] ; then - # Seek and run command - index="0" - for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - currcmdamount="$(echo "${currentopt[index]}"| awk -F ';' '{ print NF }')" - for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do - if [ "$(echo "${currentopt[index]}"| awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then - # Run command - ${currentopt[index+1]} - break - fi - done - done - break - core_exit.sh +fn_getopt_gmodserver(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + fu|force-update|update-restart) + forceupdate=1; + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + v|validate) + command_validate.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + fd|fastdl) + command_fastdl.sh;; + mi|mods-install) + command_mods_install.sh;; + mu|mods-update) + command_mods_update.sh;; + mr|mods-remove) + command_mods_remove.sh;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." + echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}fastdl\t${default}fd |Generates or update a FastDL directory for your server." + echo -e "${blue}mods-install\t${default}mi |View and install available mods/addons." + echo -e "${blue}mods-update\t${default}mu |Update installed mods/addons." + echo -e "${blue}mods-remove\t${default}mr |Remove installed mods/addons." + } | column -s $'\t' -t + esac +} + +fn_getopt_rustserver(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + fu|force-update|update-restart) + forceupdate=1; + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + v|validate) + command_validate.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + pd|postdetails) + command_postdetails.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + mi|mods-install) + command_mods_install.sh;; + mu|mods-update) + command_mods_update.sh;; + mr|mods-remove) + command_mods_remove.sh;; + wi|wipe) + command_wipe.sh;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD." + echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)" + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}mods-install\t${default}mi |View and install available mods/addons." + echo -e "${blue}mods-update\t${default}mu |Update installed mods/addons." + echo -e "${blue}mods-remove\t${default}mr |Remove installed mods/addons." + echo -e "${blue}wipe\t${default}wi |Wipe your Rust server." + } | column -s $'\t' -t + esac +} + +fn_getopt_unreal(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + mc|map-compressor) + compress_ut99_maps.sh;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." + } | column -s $'\t' -t + esac +} + + +fn_getopt_unreal2(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + fu|force-update|update-restart) + forceupdate=1; + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + v|validate) + command_validate.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + mc|map-compressor) + compress_unreal2_maps.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 fi -done + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}Checks and applies updates from SteamCMD." + echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." + } | column -s $'\t' -t + esac +} -# If we're executing this, it means command was not found -echo -e "${red}Unknown command${default}: $0 ${getopt}" -exitcode=2 -fn_opt_usage + +fn_getopt_ut2k4(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + cd|server-cd-key) + install_ut2k4_key.sh;; + mc|map-compressor) + compress_unreal2_maps.sh;; + dd|detect-deps) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + dl|detect-ldd) + command_dev_detect_ldd.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + echo -e "${blue}server-cd-key\t${default}cd |Add your server cd key" + echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps." + } | column -s $'\t' -t + esac +} + +# Don't Starve Together +if [ "${gamename}" == "Don't Starve Together" ]; then + fn_getopt_dstserver +# Garry's Mod +elif [ "${gamename}" == "Garry's Mod" ]; then + fn_getopt_gmodserver +# Minecraft +elif [ "${engine}" == "lwjgl2" ]; then + fn_getopt_minecraft +# Multi Theft Auto +elif [ "${gamename}" == "Multi Theft Auto" ]; then + fn_getopt_mta +# Mumble +elif [ "${gamename}" == "Mumble" ]; then + fn_getopt_mumble +# Teamspeak 3 +elif [ "${gamename}" == "TeamSpeak 3" ]; then + fn_getopt_teamspeak3 +elif [ "${gamename}" == "Rust" ]; then + fn_getopt_rustserver +# Unreal 2 Engine +elif [ "${engine}" == "unreal2" ]; then + if [ "${gamename}" == "Unreal Tournament 2004" ]; then + fn_getopt_ut2k4 + else + fn_getopt_unreal2 + fi +# Unreal Engine +elif [ "${engine}" == "unreal" ]; then + fn_getopt_unreal +# Generic +elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty 4" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then + fn_getopt_generic_no_update +elif [ "${gamename}" == "Factorio" ]; then + fn_getopt_generic_update_no_steam +else + fn_getopt_generic +fi core_exit.sh From e6cab16ee9274dac71b3e7f9fbf2ce1058169828 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 16:40:39 +0000 Subject: [PATCH 080/102] Update pcserver --- ProjectCars/pcserver | 117 ++++++++++++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 39 deletions(-) diff --git a/ProjectCars/pcserver b/ProjectCars/pcserver index e2564fd6f..b05dec06f 100755 --- a/ProjectCars/pcserver +++ b/ProjectCars/pcserver @@ -1,63 +1,88 @@ #!/bin/bash -# Project Cars -# Server Management Script +# Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2017 Daniel Gibbs +# Purpose: Project Cars | Server Management Script +# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors +# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki # Website: https://gameservermanagers.com + +# Debugging if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="211016" +version="170219" + +########################## +######## Settings ######## +########################## -#### Variables #### +#### Server Settings #### # Notification Alerts -# (on|off) +## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters +fn_parms(){ +parms="--config ${servercfg}" +} -# Email +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) +# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email emailalert="off" email="email@example.com" -#emailfrom="email@example.com" +emailfrom="" -# Pushbullet -# https://www.pushbullet.com/#settings +# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet pushbulletalert="off" pushbullettoken="accesstoken" +channeltag="" -# Steam login -steamuser="anonymous" -steampass="" +## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update +updateonstart="off" -# Start Variables +## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" -fn_parms(){ -parms=" --config ${servercfg}" -} +## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging +consolelogging="on" +logdays="7" -#### Advanced Variables #### +#### LinuxGSM Advanced Settings #### -# Github Branch Select +## SteamCMD Settings +# Server appid +appid="332670" +# Steam App Branch Select +# Allows to opt into the various Steam app branches. Default branch is "". +# Example: "-beta latest_experimental" +branch="" + +## Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" -githubbranch="projectcars" +githubbranch="master" -# Steam -appid="332670" +## LinuxGSM Server Details +# Do not edit +gamename="Project Cars" +engine="madness" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta beta" -branch="" +## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers +servicename="pc-server" -# Server Details -servicename="projectcars-server" -gamename="Project Cars" +#### Directories #### +# Edit with care -# Directories +## Work Directories rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" @@ -66,6 +91,8 @@ functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" filesdir="${rootdir}/serverfiles" + +## Server Specific Directories systemdir="${filesdir}" executabledir="${filesdir}" executable="./DedicatedServerCmd" @@ -73,24 +100,26 @@ servercfg="${servicename}.cfg" servercfgdefault="server.cfg" servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory backupdir="${rootdir}/backups" -# Logging -logdays="7" +## Logging Directories gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" -consolelogging="on" - scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" emaillog="${scriptlogdir}/${servicename}-email.log" -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" +## Logs Naming +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -##### Script ##### -# Do not edit +######################## +######## Script ######## +###### Do not edit ##### +######################## # Fetches core_dl for file downloads fn_fetch_core_dl(){ @@ -147,8 +176,18 @@ functionfile="${FUNCNAME}" fn_fetch_core_dl } +# Prevent from running this script as root. +if [ "$(whoami)" = "root" ]; then + if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then + echo "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + core_dl.sh core_functions.sh - getopt=$1 -core_getopt.sh +core_getopt.sh \ No newline at end of file From f9692e1201b36f292ebe180cce9e0ba18d88e0c7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 16:45:56 +0000 Subject: [PATCH 081/102] increased glibc requirement to 2.4 --- lgsm/functions/info_glibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index f884db048..97a395962 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -66,7 +66,7 @@ elif [ "${gamename}" == "No More Room in Hell" ]; then glibcrequired="2.15" glibcfix="yes" elif [ "${gamename}" == "Project Cars" ]; then - glibcrequired="2.1" + glibcrequired="2.4" glibcfix="no" elif [ "${gamename}" == "Quake 2" ]; then glibcrequired="NOT REQUIRED" From 2c8e4a3aaa7a93264b63585c1db23c15d904692d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 17:26:47 +0000 Subject: [PATCH 082/102] Added pc info also shuffled a couple of functions --- lgsm/functions/info_config.sh | 121 ++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 50 deletions(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index cb17e09d5..3bf218df0 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -49,6 +49,29 @@ fn_info_config_ark(){ fi } +fn_info_config_ballistic_overkill(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"NOT SET"} + fi +} + fn_info_config_bf1942(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -226,6 +249,27 @@ fn_info_config_minecraft(){ fi } +fn_info_config_projectcars(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} +} fn_info_config_projectzomboid(){ if [ ! -f "${servercfgfullpath}" ]; then @@ -315,33 +359,6 @@ fn_info_config_quakelive(){ fi } -fn_info_config_wolfensteinenemyterritory(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - fi -} - fn_info_config_realvirtuality(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -568,29 +585,6 @@ fn_info_config_unreal(){ fi } -fn_info_config_ballistic_overkill(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"NOT SET"} - fi -} - fn_info_config_sdtd(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -677,6 +671,33 @@ fn_info_config_mta(){ fi } +fn_info_config_wolfensteinenemyterritory(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="set net_ip" + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + fi +} + # Just Cause 2 if [ "${engine}" == "avalanche" ]; then fn_info_config_avalanche From 895591adfd6b9f54b581bf054295d83a81647886 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 17:30:50 +0000 Subject: [PATCH 083/102] missing fi --- lgsm/functions/info_config.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 3bf218df0..c34fd4243 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -249,6 +249,7 @@ fn_info_config_minecraft(){ fi } + fn_info_config_projectcars(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -269,6 +270,7 @@ fn_info_config_projectcars(){ maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} queryport=${queryport:-"NOT SET"} + fi } fn_info_config_projectzomboid(){ From dd23d64dbf3ea1046f3f6f2772ee989045d3a381 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 17:33:22 +0000 Subject: [PATCH 084/102] Added pc if --- lgsm/functions/info_config.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index c34fd4243..2c2f1c7db 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -742,6 +742,9 @@ elif [ "${gamename}" == "Quake Live" ]; then # Minecraft elif [ "${engine}" == "lwjgl2" ]; then fn_info_config_minecraft +# Project Cars +elif [ "${gamename}" == "Project Cars" ]; then + fn_info_config_projectzomboid # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then fn_info_config_projectzomboid From b0d81bf857b6fd48fc58faf47128988162043f61 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 17:46:44 +0000 Subject: [PATCH 085/102] more details updates --- lgsm/functions/command_details.sh | 2 ++ lgsm/functions/info_config.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index debf5442d..5a7cfb2fd 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -840,6 +840,8 @@ fn_display_details() { fn_details_factorio elif [ "${gamename}" == "Hurtworld" ]; then fn_details_hurtworld + elif [ "${gamename}" == "Project Cars" ]; then + fn_details_projectcars elif [ "${gamename}" == "QuakeWorld" ]; then fn_details_quake elif [ "${gamename}" == "Quake 2" ]; then diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 2c2f1c7db..8b4916367 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -257,12 +257,14 @@ fn_info_config_projectcars(){ maxplayers="${zero}" port="${zero}" queryport="${zero}" + steamport="${zero}" else servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} @@ -270,6 +272,7 @@ fn_info_config_projectcars(){ maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} queryport=${queryport:-"NOT SET"} + steamport=${steamport:-"NOT SET"} fi } From 3cdb18596aebf87cd3c8324c14e07dc10578b2dd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 17:48:17 +0000 Subject: [PATCH 086/102] corrected function name --- lgsm/functions/info_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 8b4916367..5e500afc0 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -747,7 +747,7 @@ elif [ "${engine}" == "lwjgl2" ]; then fn_info_config_minecraft # Project Cars elif [ "${gamename}" == "Project Cars" ]; then - fn_info_config_projectzomboid + fn_info_config_projectcars # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then fn_info_config_projectzomboid From fab297b750cea9791a1ed56390f375ccd59a49af Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 19:52:57 +0000 Subject: [PATCH 087/102] Added project cars --- lgsm/functions/command_details.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 5a7cfb2fd..4c8d64ecc 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -487,6 +487,17 @@ fn_details_mumble(){ } | column -s $'\t' -t } +fn_details_projectcars(){ + echo -e "netstat -atunp | grep DedicatedS" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Steam\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + fn_details_projectzomboid(){ echo -e "netstat -atunp | grep java" echo -e "" From d84fb4cd0c6267780422b9738397680c4d771767 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 19:59:58 +0000 Subject: [PATCH 088/102] added space to fix serverpassword bug --- lgsm/functions/info_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 5e500afc0..47fb5b33c 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -260,7 +260,7 @@ fn_info_config_projectcars(){ steamport="${zero}" else servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') From 9e5a71a528ac80a41157eab853c22f3f492ca207 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 20:02:07 +0000 Subject: [PATCH 089/102] corrected maxplayers --- lgsm/functions/info_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 47fb5b33c..a179efbb4 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -261,7 +261,7 @@ fn_info_config_projectcars(){ else servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') From 888140c71129edc4682c1f5a7e4d3b28650ee8b7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 21:33:33 +0000 Subject: [PATCH 090/102] added pc --- lgsm/functions/command_details.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 4c8d64ecc..106eb0041 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -315,7 +315,7 @@ fn_details_ports(){ parmslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file - local ports_edit_array=( "avalanche" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" ) + local ports_edit_array=( "avalanche" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" ) for port_edit in "${ports_edit_array[@]}" do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then From 20f63bcc10ca809dd2ef99742a8d5a3f4c5ca451 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Mar 2017 23:18:31 +0000 Subject: [PATCH 091/102] Lots of garrys mod stuff --- lgsm/functions/command_fastdl.sh | 149 +++++++++++++++++++++++++------ 1 file changed, 121 insertions(+), 28 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 0c4766704..3fdd705c5 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -13,7 +13,7 @@ check.sh # Directories if [ -z "${webdir}" ]; then - webdir="${lgsmdir}/public_html" + webdir="${rootdir}/public_html" fi fastdldir="${webdir}/fastdl" addonsdir="${systemdir}/addons" @@ -121,6 +121,88 @@ fn_clear_old_fastdl(){ } fn_fastdl_gmod(){ + # Copy all needed files for FastDL + if [ -n "${copyflag}" ]; then + # Removes all existing FastDL files. + if [ -d "${fastdldir}" ]; then + echo -e "removing existing FastDL files" + sleep 0.1 + fileswc=1 + totalfileswc=$(find "${fastdldir}" | wc -l) + tput sc + while read -r filetoremove; do + tput rc; tput el + printf "removing ${fileswc} / ${totalfileswc} : ${filetoremove}..." + ((fileswc++)) + rm -rf "${filetoremove}" + ((exitcode=$?)) + if [ ${exitcode} -ne 0 ]; then + fn_script_log_fatal "Removing ${filetoremove}" + break + else + fn_script_log_pass "Removing ${filetoremove}" + fi + sleep 0.01 + done < <(find "${fastdldir}") + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fi + fn_fastdl_dirs + + echo -e "copying files to ${fastdldir}" + fn_script_log_info "Copying files to ${fastdldir}" + else + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + rm -f "${tmpdir}/fastdl_files_to_compress.txt" + fi + echo -e "analysing required files" + fn_script_log_info "Analysing required files" + fi + cd "${systemdir}" + local 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 + fileswc=0 + tput sc + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "copying ${directory} ${allowed_extention} : ${fileswc}..." + fi + while read -r ext; do + ((fileswc++)) + if [ -n "${copyflag}" ]; then + tput rc; tput el + printf "copying ${directory} ${allowed_extention} : ${fileswc}..." + sleep 0.01 + cp --parents "${ext}" "${fastdldir}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${ext} > ${fastdldir}" + core_exit.sh + else + fn_script_log_pass "Copying ${ext} > ${fastdldir}" + fi + else + tput rc; tput el + printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + sleep 0.01 + echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fi + done < <(find . -type f -iname ${allowed_extention}) + + if [ -z "${copyflag}" ]; then + tput rc; tput el + printf "gathering ${allowed_extention} : ${fileswc}..." + fi + if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + fn_print_ok_eol_nl + fi + done # Correct addons directory structure for FastDL if [ -d "${fastdldir}/addons" ]; then echo -en "updating addons file structure..." @@ -136,7 +218,7 @@ fn_fastdl_gmod(){ fi # Clear addons directory in fastdl if [ "${cleargmodaddons}" == "on" ]; then - echo -en "clearing addons dir from fastdl dir" + echo -en "clearing addons dir from fastdl dir..." sleep 1 rm -R "${fastdldir:?}/addons" exitcode=$? @@ -165,6 +247,31 @@ fn_fastdl_gmod(){ fn_script_log_pass "correcting DarkRP files" fi fi + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + # Calculates total file size + while read dufile; do + filesize=$(du -b "${dufile}"| awk '{ print $1 }') + filesizetotal=$(( ${filesizetotal} + ${filesize} )) + done <"${tmpdir}/fastdl_files_to_compress.txt" + fi + + if [ -z "${copyflag}" ]; then + echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + rm "${tmpdir}/fastdl_files_to_compress.txt" + if fn_prompt_yn "Continue?" Y; then + copyflag=1 + fn_fastdl_gmod + else + core_exit.sh + fi + else + if [ "${gamename}" == "Garry's Mod" ]; then + fn_fastdl_gmod_lua_enforcer + fi + fn_fastdl_bzip2 + fi } # Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 @@ -244,30 +351,14 @@ fn_fastdl_source(){ for directory in "${directorys_array[@]}" do if [ -d "${systemdir}/${directory}" ]; then - if [ "${gamename}" == "Garry's Mod" ]; then - if [ "${directory}" == "maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" ) - elif [ "${directory}" == "materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" ) - elif [ "${directory}" == "models" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" ) - elif [ "${directory}" == "particles" ]; then - local allowed_extentions_array=( "*.pcf" ) - elif [ "${directory}" == "sounds" ]; then - local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) - elif [ "${directory}" == "resources" ]; then - local allowed_extentions_array=( "*.otf" "*.ttf" "*.png" ) - fi - else - if [ "${directory}" == "maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) - elif [ "${directory}" == "materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) - elif [ "${directory}" == "particles" ]; then - local allowed_extentions_array=( "*.pcf" ) - elif [ "${directory}" == "sounds" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) - fi + if [ "${directory}" == "maps" ]; then + local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + elif [ "${directory}" == "sounds" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) fi for allowed_extention in "${allowed_extentions_array[@]}" do @@ -380,7 +471,7 @@ fn_fastdl_gmod_lua_enforcer(){ fn_fastdl_bzip2(){ while read -r filetocompress; do echo -en "compressing ${filetocompress}..." - bzip2 "${filetocompress}" + bzip2 -f "${filetocompress}" exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl @@ -406,9 +497,11 @@ fn_print_header echo "More info: https://git.io/vyk9a" echo "" fn_fastdl_config -fn_fastdl_source + if [ "${gamename}" == "Garry's Mod" ]; then fn_fastdl_gmod +else + fn_fastdl_source fi fn_fastdl_completed core_exit.sh From aeaa454814dbcb4d59f69857bde4b5e67b4872c9 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 5 Mar 2017 04:19:35 +0100 Subject: [PATCH 092/102] Missing github info for BladeSymphony --- BladeSymphony/bsserver | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index b0eb68e9b..470221666 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -75,6 +75,13 @@ appid="228780" # Example: "-beta latest_experimental" branch="" +## Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + ## LinuxGSM Server Details # Do not edit gamename="Blade Symphony" From bf8ebfe3637d232cdd67b735343df9ab5a28f122 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 5 Mar 2017 08:04:31 +0100 Subject: [PATCH 093/102] Cleaning & fixes & functions rearranging --- lgsm/functions/command_fastdl.sh | 244 +++++++++++++------------------ 1 file changed, 100 insertions(+), 144 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 3fdd705c5..96f810c06 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -22,57 +22,97 @@ luasvautorundir="${systemdir}/lua/autorun/server" luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" -fn_check_bzip2(){ - # Returns true if not installed - if [ -z "$(command -v bzip2)" ]; then - fn_print_fail "bzip2 is not installed" - fn_script_log_fatal "bzip2 is not installed" - core_exit.sh - fi -} +# Check if bzip2 is installed +if [ -z "$(command -v bzip2)" ]; then + fn_print_fail "bzip2 is not installed" + fn_script_log_fatal "bzip2 is not installed" + core_exit.sh +fi + +# Header +fn_print_header +echo "More info: https://git.io/vyk9a" +echo "" # Prompts user for FastDL creation settings -fn_fastdl_config(){ - echo "FastDL setup" - echo "=================================" +echo "${commandaction} setup" +echo "=================================" - # Prompt for clearing old files if directory was already here - if [ -d "${fastdldir}" ]; then - fn_print_warning_nl "FastDL directory already exists." - echo "${fastdldir}" - echo "" - if fn_prompt_yn "Overwrite existing directory?" Y; then - fn_script_log_info "Overwrite existing directory: YES" - else - core_exit.sh - fi +# Prompt for clearing old files if directory was already here +if [ -d "${fastdldir}" ]; then + fn_print_warning_nl "FastDL directory already exists." + echo "${fastdldir}" + echo "" + if fn_prompt_yn "Overwrite existing directory?" Y; then + fn_script_log_info "Overwrite existing directory: YES" + else + core_exit.sh fi +fi - # Garry's Mod Specific - if [ "${gamename}" == "Garry's Mod" ]; then - # Prompt to clear addons dir from fastdl, can use unnecessary space or not be required depending on addon's file structures - if fn_prompt_yn "Clear addons directory from FastDL?" Y; then - cleargmodaddons="on"; - fn_script_log_info "Clear addons directory from FastDL: YES" - else - cleargmodaddons="off"; - fn_script_log_info "Clear addons directory from FastDL: NO" - fi +# Garry's Mod Specific +if [ "${gamename}" == "Garry's Mod" ]; 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" + fn_script_log_info "Force clients to download files: YES" + else + luaresource="off" + fn_script_log_info "Force clients to download filesr: NO" + fi +fi + +fn_clear_old_fastdl(){ + # Clearing old FastDL + if [ -d "${fastdldir}" ];then + echo -en "clearing existing FastDL directory ${fastdldir}..." + rm -R "${fastdldir:?}"/* + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" + fi + sleep 0.5 + fi +} - # Prompt for download enforcer, which is using a .lua addfile resource generator - if fn_prompt_yn "Use client download enforcer?" Y; then - luaressource="on" - fn_script_log_info "Use client download enforcer: YES" +fn_clear_old_fastdl_alt(){ + if [ -d "${fastdldir}" ]; then + echo -e "removing existing FastDL files" + sleep 0.1 + fileswc=1 + totalfileswc=$(find "${fastdldir}" | wc -l) + tput sc + while read -r filetoremove; do + tput rc; tput el + printf "removing ${fileswc} / ${totalfileswc} : ${filetoremove}..." + ((fileswc++)) + rm -rf "${filetoremove}" + ((exitcode=$?)) + if [ ${exitcode} -ne 0 ]; then + fn_script_log_fatal "Removing ${filetoremove}" + break + else + fn_script_log_pass "Removing ${filetoremove}" + fi + sleep 0.01 + done < <(find "${fastdldir}") + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh else - luaressource="off" - fn_script_log_info "Use client download enforcer: NO" + fn_print_ok_eol_nl fi fi } fn_fastdl_dirs(){ # Check and create directories - if [ ! -d "${modsdir}" ];then + if [ ! -d "${webdir}" ];then echo -en "creating web directory ${webdir}..." mkdir -p "${webdir}" exitcode=$? @@ -102,57 +142,12 @@ fn_fastdl_dirs(){ fi } -fn_clear_old_fastdl(){ - # Clearing old FastDL if user answered yes - if [ ! -d "${modsdir}" ];then - echo -en "clearing existing FastDL directory ${fastdldir}..." - rm -R "${fastdldir:?}"/* - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" - fi - sleep 0.5 - fi -} - fn_fastdl_gmod(){ # Copy all needed files for FastDL if [ -n "${copyflag}" ]; then - # Removes all existing FastDL files. - if [ -d "${fastdldir}" ]; then - echo -e "removing existing FastDL files" - sleep 0.1 - fileswc=1 - totalfileswc=$(find "${fastdldir}" | wc -l) - tput sc - while read -r filetoremove; do - tput rc; tput el - printf "removing ${fileswc} / ${totalfileswc} : ${filetoremove}..." - ((fileswc++)) - rm -rf "${filetoremove}" - ((exitcode=$?)) - if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${filetoremove}" - break - else - fn_script_log_pass "Removing ${filetoremove}" - fi - sleep 0.01 - done < <(find "${fastdldir}") - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_eol_nl - fi - fi + # Clear previous FastDL dir + fn_clear_old_fastdl_alt fn_fastdl_dirs - echo -e "copying files to ${fastdldir}" fn_script_log_info "Copying files to ${fastdldir}" else @@ -217,19 +212,17 @@ fn_fastdl_gmod(){ fn_script_log_pass "updating addons file structure" fi # Clear addons directory in fastdl - if [ "${cleargmodaddons}" == "on" ]; then - echo -en "clearing addons dir from fastdl dir..." - sleep 1 - rm -R "${fastdldir:?}/addons" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "clearing addons dir from fastdl dir" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "clearing addons dir from fastdl dir" - fi + echo -en "clearing addons dir from fastdl dir..." + sleep 1 + rm -R "${fastdldir:?}/addons" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "clearing addons dir from fastdl dir" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "clearing addons dir from fastdl dir" fi fi # Correct content that may be into a lua directory by mistake like some darkrpmodification addons @@ -307,36 +300,8 @@ fn_human_readable_file_size() { fn_fastdl_source(){ # Copy all needed files for FastDL if [ -n "${copyflag}" ]; then - # Removes all existing FastDL files. - if [ -d "${fastdldir}" ]; then - echo -e "removing existing FastDL files" - sleep 0.1 - fileswc=1 - totalfileswc=$(find "${fastdldir}" | wc -l) - tput sc - while read -r filetoremove; do - tput rc; tput el - printf "removing ${fileswc} / ${totalfileswc} : ${filetoremove}..." - ((fileswc++)) - rm -rf "${filetoremove}" - ((exitcode=$?)) - if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${filetoremove}" - break - else - fn_script_log_pass "Removing ${filetoremove}" - fi - sleep 0.01 - done < <(find "${fastdldir}") - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_eol_nl - fi - fi + fn_clear_old_fastdl_alt fn_fastdl_dirs - echo -e "copying files to ${fastdldir}" fn_script_log_info "Copying files to ${fastdldir}" else @@ -347,8 +312,8 @@ fn_fastdl_source(){ fn_script_log_info "Analysing required files" fi - local directorys_array=( "maps" "materials" "models" "particles" "sounds" "resources" ) - for directory in "${directorys_array[@]}" + local directories_array=( "maps" "materials" "models" "particles" "sounds" "resources" ) + for directory in "${directories_array[@]}" do if [ -d "${systemdir}/${directory}" ]; then if [ "${directory}" == "maps" ]; then @@ -449,7 +414,7 @@ fn_fastdl_gmod_lua_enforcer(){ fi fi # Generate new one if user said yes - if [ "${luaressource}" == "on" ]; then + if [ "${luaresource}" == "on" ]; then echo -en "creating new download enforcer: ${luafastdlfile}..." touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path @@ -484,24 +449,15 @@ fn_fastdl_bzip2(){ done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) } -fn_fastdl_completed(){ - # Finished message - echo "FastDL files are located in:" - echo "${webdir}" - echo "FastDL completed" - fn_script_log_info "FastDL completed" -} - # Run functions -fn_print_header -echo "More info: https://git.io/vyk9a" -echo "" -fn_fastdl_config - if [ "${gamename}" == "Garry's Mod" ]; then fn_fastdl_gmod else fn_fastdl_source fi -fn_fastdl_completed +# Finished message +echo "FastDL files are located in:" +echo "${webdir}" +echo "FastDL completed" +fn_script_log_info "FastDL completed" core_exit.sh From 71dcf5937839f0bb1182d50fa076bdb0a16c0daf Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 5 Mar 2017 08:22:33 +0100 Subject: [PATCH 094/102] Second pass cleaning & compressing output rework --- lgsm/functions/command_fastdl.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 96f810c06..d68d16c5e 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -259,11 +259,6 @@ fn_fastdl_gmod(){ else core_exit.sh fi - else - if [ "${gamename}" == "Garry's Mod" ]; then - fn_fastdl_gmod_lua_enforcer - fi - fn_fastdl_bzip2 fi } @@ -389,11 +384,6 @@ fn_fastdl_source(){ else core_exit.sh fi - else - if [ "${gamename}" == "Garry's Mod" ]; then - fn_fastdl_gmod_lua_enforcer - fi - fn_fastdl_bzip2 fi } @@ -434,8 +424,10 @@ fn_fastdl_gmod_lua_enforcer(){ } fn_fastdl_bzip2(){ + echo -en "compressing files..." + echo "" while read -r filetocompress; do - echo -en "compressing ${filetocompress}..." + echo -en "\r\033[Kcompressing ${filetocompress}..." bzip2 -f "${filetocompress}" exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -447,14 +439,17 @@ fn_fastdl_bzip2(){ fn_script_log_pass "compressing ${filetocompress}" fi done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) + echo "" } # Run functions if [ "${gamename}" == "Garry's Mod" ]; then fn_fastdl_gmod + fn_fastdl_gmod_lua_enforcer else fn_fastdl_source fi +fn_fastdl_bzip2 # Finished message echo "FastDL files are located in:" echo "${webdir}" From 1346393250489775739ef2eb3541f115918d137f Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 5 Mar 2017 08:36:41 +0100 Subject: [PATCH 095/102] less compression output & clear tabs --- lgsm/functions/command_fastdl.sh | 37 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index d68d16c5e..c4495e99a 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -62,22 +62,22 @@ if [ "${gamename}" == "Garry's Mod" ]; then fi fi -fn_clear_old_fastdl(){ - # Clearing old FastDL - if [ -d "${fastdldir}" ];then - echo -en "clearing existing FastDL directory ${fastdldir}..." - rm -R "${fastdldir:?}"/* - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" - fi - sleep 0.5 - fi +fn_clear_old_fastdl(){ + # Clearing old FastDL + if [ -d "${fastdldir}" ];then + echo -en "clearing existing FastDL directory ${fastdldir}..." + rm -R "${fastdldir:?}"/* + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" + fi + sleep 0.5 + fi } fn_clear_old_fastdl_alt(){ @@ -435,11 +435,10 @@ fn_fastdl_bzip2(){ fn_script_log_fatal "compressing ${filetocompress}" core_exit.sh else - fn_print_ok_eol_nl fn_script_log_pass "compressing ${filetocompress}" fi done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) - echo "" + fn_print_ok_eol_nl } # Run functions @@ -452,7 +451,7 @@ fi fn_fastdl_bzip2 # Finished message echo "FastDL files are located in:" -echo "${webdir}" +echo "${fastdldir}" echo "FastDL completed" fn_script_log_info "FastDL completed" core_exit.sh From bbb95362346cf2a3ff7bb0e18d7848619871900c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Mar 2017 15:09:08 +0000 Subject: [PATCH 096/102] directory not used here --- lgsm/functions/command_fastdl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index c4495e99a..4aa50fbe7 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -165,13 +165,13 @@ fn_fastdl_gmod(){ tput sc if [ -z "${copyflag}" ]; then tput rc; tput el - printf "copying ${directory} ${allowed_extention} : ${fileswc}..." + printf "copying ${allowed_extention} : ${fileswc}..." fi while read -r ext; do ((fileswc++)) if [ -n "${copyflag}" ]; then tput rc; tput el - printf "copying ${directory} ${allowed_extention} : ${fileswc}..." + printf "copying ${allowed_extention} : ${fileswc}..." sleep 0.01 cp --parents "${ext}" "${fastdldir}" exitcode=$? @@ -184,7 +184,7 @@ fn_fastdl_gmod(){ fi else tput rc; tput el - printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + printf "gathering ${allowed_extention} : ${fileswc}..." sleep 0.01 echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" fi From a8ae8a43afdc0dd470050ce5146ad8abce510df8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Mar 2017 15:13:06 +0000 Subject: [PATCH 097/102] minor tidy --- lgsm/functions/command_fastdl.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 4aa50fbe7..fab1f38a8 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -63,8 +63,8 @@ if [ "${gamename}" == "Garry's Mod" ]; then fi fn_clear_old_fastdl(){ - # Clearing old FastDL - if [ -d "${fastdldir}" ];then + # Clearing old FastDL + if [ -d "${fastdldir}" ]; then echo -en "clearing existing FastDL directory ${fastdldir}..." rm -R "${fastdldir:?}"/* exitcode=$? @@ -112,7 +112,7 @@ fn_clear_old_fastdl_alt(){ fn_fastdl_dirs(){ # Check and create directories - if [ ! -d "${webdir}" ];then + if [ ! -d "${webdir}" ]; then echo -en "creating web directory ${webdir}..." mkdir -p "${webdir}" exitcode=$? @@ -126,7 +126,7 @@ fn_fastdl_dirs(){ fi sleep 0.5 fi - if [ ! -d "${fastdldir}" ];then + if [ ! -d "${fastdldir}" ]; then echo -en "creating fastdl directory ${fastdldir}..." mkdir -p "${fastdldir}" exitcode=$? From ae9d308084111fbdb0a5d25e674a8a5988ac0fd6 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 5 Mar 2017 22:22:51 +0100 Subject: [PATCH 098/102] major fastdl re-think --- lgsm/functions/command_fastdl.sh | 368 +++++++++++++++---------------- 1 file changed, 173 insertions(+), 195 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index fab1f38a8..be97474c6 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -62,13 +62,14 @@ if [ "${gamename}" == "Garry's Mod" ]; then fi fi +# Clears any fastdl directory content fn_clear_old_fastdl(){ # Clearing old FastDL if [ -d "${fastdldir}" ]; then echo -en "clearing existing FastDL directory ${fastdldir}..." - rm -R "${fastdldir:?}"/* + rm -R "${fastdldir:?}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" core_exit.sh @@ -80,36 +81,6 @@ fn_clear_old_fastdl(){ fi } -fn_clear_old_fastdl_alt(){ - if [ -d "${fastdldir}" ]; then - echo -e "removing existing FastDL files" - sleep 0.1 - fileswc=1 - totalfileswc=$(find "${fastdldir}" | wc -l) - tput sc - while read -r filetoremove; do - tput rc; tput el - printf "removing ${fileswc} / ${totalfileswc} : ${filetoremove}..." - ((fileswc++)) - rm -rf "${filetoremove}" - ((exitcode=$?)) - if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${filetoremove}" - break - else - fn_script_log_pass "Removing ${filetoremove}" - fi - sleep 0.01 - done < <(find "${fastdldir}") - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_eol_nl - fi - fi -} - fn_fastdl_dirs(){ # Check and create directories if [ ! -d "${webdir}" ]; then @@ -142,59 +113,146 @@ fn_fastdl_dirs(){ fi } -fn_fastdl_gmod(){ - # Copy all needed files for FastDL - if [ -n "${copyflag}" ]; then - # Clear previous FastDL dir - fn_clear_old_fastdl_alt - fn_fastdl_dirs - echo -e "copying files to ${fastdldir}" - fn_script_log_info "Copying files to ${fastdldir}" +# Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 +fn_human_readable_file_size(){ + local abbrevs=( + $((1 << 60)):ZB + $((1 << 50)):EB + $((1 << 40)):TB + $((1 << 30)):GB + $((1 << 20)):MB + $((1 << 10)):KB + $((1)):bytes + ) + + local bytes="${1}" + local precision="${2}" + + if [[ "${bytes}" == "1" ]]; then + echo "1 byte" + else + for item in "${abbrevs[@]}"; do + local factor="${item%:*}" + local abbrev="${item#*:}" + if [[ "${bytes}" -ge "${factor}" ]]; then + local size="$(bc -l <<< "${bytes} / ${factor}")" + printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" + break + fi + done + fi +} + +# Provides info about the fastdl directory content and prompts for confirmation +fn_fastdl_preview(){ + # Remove any file list + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + rm -f "${tmpdir}/fastdl_files_to_compress.txt" + fi + echo -e "analysing required files" + fn_script_log_info "Analysing required files" + # Garry's Mod + if [ "${gamename}" == "Garry's Mod" ]; 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 + fileswc=0 + tput sc + while read -r ext; do + ((fileswc++)) + tput rc; tput el + printf "gathering ${allowed_extention} : ${fileswc}..." + echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find . -type f -iname ${allowed_extention}) + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done + # Source engine else - if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - rm -f "${tmpdir}/fastdl_files_to_compress.txt" - fi - echo -e "analysing required files" - fn_script_log_info "Analysing required files" + fastdl_directories_array=( "maps" "materials" "models" "particles" "sounds" "resources" ) + for directory in "${fastdl_directories_array[@]}"; do + if [ -d "${systemdir}/${directory}" ]; then + if [ "${directory}" == "maps" ]; then + local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) + elif [ "${directory}" == "models" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" ) + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + elif [ "${directory}" == "sounds" ]; then + local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + fi + for allowed_extention in "${allowed_extentions_array[@]}"; do + fileswc=0 + tput sc + while read -r ext; do + ((fileswc++)) + tput rc; tput el + printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + 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}..." + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done + fi + done + fi + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + echo "calculating total file size..." + sleep 0.5 + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + # Calculates total file size + while read dufile; do + filesize=$(stat -c %s "${dufile}") + filesizetotal=$(( ${filesizetotal} + ${filesize} )) + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Calculating total file size." + core_exit.sh + fi + done <"${tmpdir}/fastdl_files_to_compress.txt" + else + fn_print_fail_eol_nl "generating file list" + fn_script_log_fatal "Generating file list." + core_exit.sh fi - cd "${systemdir}" - local allowed_extentions_array=( "*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav" ) + echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + rm "${tmpdir}/fastdl_files_to_compress.txt" + if ! fn_prompt_yn "Continue?" Y; then + fn_script_log "User exited" + core_exit.sh + fi +} + +# Builds Garry's Mod fastdl directory content +fn_fastdl_gmod(){ + cd "${systemdir}" || exit for allowed_extention in "${allowed_extentions_array[@]}" do fileswc=0 tput sc - if [ -z "${copyflag}" ]; then + while read -r fastdlfile; do + ((fileswc++)) tput rc; tput el printf "copying ${allowed_extention} : ${fileswc}..." - fi - while read -r ext; do - ((fileswc++)) - if [ -n "${copyflag}" ]; then - tput rc; tput el - printf "copying ${allowed_extention} : ${fileswc}..." - sleep 0.01 - cp --parents "${ext}" "${fastdldir}" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${ext} > ${fastdldir}" - core_exit.sh - else - fn_script_log_pass "Copying ${ext} > ${fastdldir}" - fi + cp --parents "${fastdlfile}" "${fastdldir}" + exitcode=$? + if [ ${exitcode} -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}" + core_exit.sh else - tput rc; tput el - printf "gathering ${allowed_extention} : ${fileswc}..." - sleep 0.01 - echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" fi done < <(find . -type f -iname ${allowed_extention}) - - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering ${allowed_extention} : ${fileswc}..." - fi - if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl fi done @@ -248,153 +306,74 @@ fn_fastdl_gmod(){ filesizetotal=$(( ${filesizetotal} + ${filesize} )) done <"${tmpdir}/fastdl_files_to_compress.txt" fi - - if [ -z "${copyflag}" ]; then - echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" - fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" - rm "${tmpdir}/fastdl_files_to_compress.txt" - if fn_prompt_yn "Continue?" Y; then - copyflag=1 - fn_fastdl_gmod - else - core_exit.sh - fi - fi -} - -# Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 -fn_human_readable_file_size() { - local abbrevs=( - $((1 << 60)):ZB - $((1 << 50)):EB - $((1 << 40)):TB - $((1 << 30)):GB - $((1 << 20)):MB - $((1 << 10)):KB - $((1)):bytes - ) - - local bytes="${1}" - local precision="${2}" - - if [[ "${bytes}" == "1" ]]; then - echo "1 byte" - else - for item in "${abbrevs[@]}"; do - local factor="${item%:*}" - local abbrev="${item#*:}" - if [[ "${bytes}" -ge "${factor}" ]]; then - local size="$(bc -l <<< "${bytes} / ${factor}")" - printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" - break - fi - done - fi } fn_fastdl_source(){ - # Copy all needed files for FastDL - if [ -n "${copyflag}" ]; then - fn_clear_old_fastdl_alt - fn_fastdl_dirs - echo -e "copying files to ${fastdldir}" - fn_script_log_info "Copying files to ${fastdldir}" - else - if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - rm -f "${tmpdir}/fastdl_files_to_compress.txt" - fi - echo -e "analysing required files" - fn_script_log_info "Analysing required files" - fi - - local directories_array=( "maps" "materials" "models" "particles" "sounds" "resources" ) - for directory in "${directories_array[@]}" + for directory in "${fastdl_directories_array[@]}" do if [ -d "${systemdir}/${directory}" ]; then if [ "${directory}" == "maps" ]; then local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) elif [ "${directory}" == "materials" ]; then local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" ) + elif [ "${directory}" == "models" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" ) elif [ "${directory}" == "particles" ]; then local allowed_extentions_array=( "*.pcf" ) elif [ "${directory}" == "sounds" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.mdl" "*.phy" "*.jpg" "*.png" ) + local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) fi for allowed_extention in "${allowed_extentions_array[@]}" do fileswc=0 tput sc - if [ -z "${copyflag}" ]; then + while read -r fastdlfile; do + ((fileswc++)) tput rc; tput el printf "copying ${directory} ${allowed_extention} : ${fileswc}..." - fi - while read -r mapfile; do - ((fileswc++)) - if [ -n "${copyflag}" ]; then - tput rc; tput el - printf "copying ${directory} ${allowed_extention} : ${fileswc}..." - sleep 0.01 - if [ ! -d "${fastdldir}/${directory}" ]; then - mkdir "${fastdldir}/${directory}" - fi - cp "${mapfile}" "${fastdldir}/${directory}" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${mapfile} > ${fastdldir}/${directory}" - core_exit.sh - else - fn_script_log_pass "Copying ${mapfile} > ${fastdldir}/${directory}" - fi + sleep 0.01 + if [ ! -d "${fastdldir}/${directory}" ]; then + mkdir "${fastdldir}/${directory}" + fi + cp "${fastdlfile}" "${fastdldir}/${directory}" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${directory}" + core_exit.sh else - tput rc; tput el - printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." - sleep 0.01 - echo "${mapfile}" >> "${tmpdir}/fastdl_files_to_compress.txt" + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${directory}" fi done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention}) - - if [ -z "${copyflag}" ]; then - tput rc; tput el - printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." - fi - if [ ${fileswc} != 0 ]&&[ -n "${copyflag}" ]||[ -z "${copyflag}" ]; then + if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl fi done fi done +} - if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") - # Calculates total file size - while read dufile; do - filesize=$(du -b "${dufile}"| awk '{ print $1 }') - filesizetotal=$(( ${filesizetotal} + ${filesize} )) - done <"${tmpdir}/fastdl_files_to_compress.txt" - fi - - if [ -z "${copyflag}" ]; then - echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" - fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" - rm "${tmpdir}/fastdl_files_to_compress.txt" - if fn_prompt_yn "Continue?" Y; then - copyflag=1 - fn_fastdl_source - else - core_exit.sh - fi +# Builds the fastdl directory content +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 + fn_fastdl_gmod + fn_fastdl_gmod_dl_enforcer + else + fn_fastdl_source fi } # Generate lua file that will force download any file into the FastDL directory -fn_fastdl_gmod_lua_enforcer(){ +fn_fastdl_gmod_dl_enforcer(){ # Clear old lua file if [ -f "${luafastdlfullpath}" ]; then echo -en "removing existing download enforcer: ${luafastdlfile}..." rm "${luafastdlfullpath:?}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fatal "removing existing download enforcer ${luafastdlfullpath}" core_exit.sh @@ -408,11 +387,11 @@ fn_fastdl_gmod_lua_enforcer(){ echo -en "creating new download enforcer: ${luafastdlfile}..." touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path - find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do - echo "resource.AddFile( "\""${line}"\"" )" >> "${luafastdlfullpath}" - done + while read line; do + echo "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fatal "creating new download enforcer ${luafastdlfullpath}" core_exit.sh @@ -423,6 +402,7 @@ fn_fastdl_gmod_lua_enforcer(){ fi } +# Compresses FastDL files using bzip2 fn_fastdl_bzip2(){ echo -en "compressing files..." echo "" @@ -430,7 +410,7 @@ fn_fastdl_bzip2(){ echo -en "\r\033[Kcompressing ${filetocompress}..." bzip2 -f "${filetocompress}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fatal "compressing ${filetocompress}" core_exit.sh @@ -442,12 +422,10 @@ fn_fastdl_bzip2(){ } # Run functions -if [ "${gamename}" == "Garry's Mod" ]; then - fn_fastdl_gmod - fn_fastdl_gmod_lua_enforcer -else - fn_fastdl_source -fi +fn_fastdl_preview +fn_clear_old_fastdl +fn_fastdl_dirs +fn_fastdl_build fn_fastdl_bzip2 # Finished message echo "FastDL files are located in:" From 62aa1c0cda50d9a15ec0b72fe9d34f1c2f58fdda Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Mar 2017 21:40:45 +0000 Subject: [PATCH 099/102] message not required --- lgsm/functions/command_fastdl.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index be97474c6..0cd0012d6 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -228,7 +228,7 @@ fn_fastdl_preview(){ if ! fn_prompt_yn "Continue?" Y; then fn_script_log "User exited" core_exit.sh - fi + fi } # Builds Garry's Mod fastdl directory content @@ -404,8 +404,6 @@ fn_fastdl_gmod_dl_enforcer(){ # Compresses FastDL files using bzip2 fn_fastdl_bzip2(){ - echo -en "compressing files..." - echo "" while read -r filetocompress; do echo -en "\r\033[Kcompressing ${filetocompress}..." bzip2 -f "${filetocompress}" From c32be4e661c3495277a622a5c262534c9d66fac0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Mar 2017 21:43:23 +0000 Subject: [PATCH 100/102] capitals for some log messages --- lgsm/functions/command_fastdl.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 0cd0012d6..8d558a670 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -263,11 +263,11 @@ fn_fastdl_gmod(){ exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "updating addons file structure" + fn_script_log_fatal "Updating addons file structure" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "updating addons file structure" + fn_script_log_pass "Updating addons file structure" fi # Clear addons directory in fastdl echo -en "clearing addons dir from fastdl dir..." @@ -276,11 +276,11 @@ fn_fastdl_gmod(){ exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "clearing addons dir from fastdl dir" + fn_script_log_fatal "Clearing addons dir from fastdl dir" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "clearing addons dir from fastdl dir" + fn_script_log_pass "Clearing addons dir from fastdl dir" fi fi # Correct content that may be into a lua directory by mistake like some darkrpmodification addons @@ -291,11 +291,11 @@ fn_fastdl_gmod(){ exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "correcting DarkRP files" + fn_script_log_fatal "Correcting DarkRP files" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "correcting DarkRP files" + fn_script_log_pass "Correcting DarkRP files" fi fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then @@ -375,11 +375,11 @@ fn_fastdl_gmod_dl_enforcer(){ exitcode=$? if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "removing existing download enforcer ${luafastdlfullpath}" + fn_script_log_fatal "Removing existing download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "removing existing download enforcer ${luafastdlfullpath}" + fn_script_log_pass "Removing existing download enforcer ${luafastdlfullpath}" fi fi # Generate new one if user said yes @@ -393,11 +393,11 @@ fn_fastdl_gmod_dl_enforcer(){ exitcode=$? if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "creating new download enforcer ${luafastdlfullpath}" + fn_script_log_fatal "Creating new download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "creating new download enforcer ${luafastdlfullpath}" + fn_script_log_pass "Creating new download enforcer ${luafastdlfullpath}" fi fi } @@ -410,10 +410,10 @@ fn_fastdl_bzip2(){ exitcode=$? if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "compressing ${filetocompress}" + fn_script_log_fatal "Compressing ${filetocompress}" core_exit.sh else - fn_script_log_pass "compressing ${filetocompress}" + fn_script_log_pass "Compressing ${filetocompress}" fi done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) fn_print_ok_eol_nl From feea45d6914e76cb4fc5dea9a77e3918e9fa1748 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 6 Mar 2017 17:44:14 +0000 Subject: [PATCH 101/102] Version 170305 --- 7DaysToDie/sdtdserver | 2 +- ARKSurvivalEvolved/arkserver | 2 +- Arma3/arma3server | 2 +- BallisticOverkill/boserver | 2 +- Battlefield1942/bf1942server | 2 +- BlackMesa/bmdmserver | 2 +- BladeSymphony/bsserver | 2 +- BrainBread2/bb2server | 2 +- CallOfDuty/codserver | 2 +- CallOfDuty2/cod2server | 2 +- CallOfDuty4/cod4server | 2 +- CallOfDutyUnitedOffensive/coduoserver | 2 +- CallOfDutyWorldAtWar/codwawserver | 2 +- CodenameCURE/ccserver | 2 +- CounterStrike/csserver | 2 +- CounterStrikeConditionZero/csczserver | 2 +- CounterStrikeGlobalOffensive/csgoserver | 2 +- CounterStrikeSource/cssserver | 2 +- DayOfDefeat/dodserver | 2 +- DayOfDefeatSource/dodsserver | 2 +- DayOfInfamy/doiserver | 2 +- DeathmatchClassic/dmcserver | 2 +- DontStarveTogether/dstserver | 2 +- DoubleActionBoogaloo/dabserver | 2 +- EmpiresMod/emserver | 2 +- Factorio/fctrserver | 2 +- FistfulOfFrags/fofserver | 2 +- GarrysMod/gmodserver | 2 +- GoldenEyeSource/gesserver | 2 +- HalfLife2Deathmatch/hl2dmserver | 2 +- HalfLifeDeathmatch/hldmserver | 2 +- HalfLifeDeathmatchSource/hldmsserver | 2 +- Hurtworld/hwserver | 2 +- Insurgency/insserver | 2 +- JustCause2/jc2server | 2 +- KillingFloor/kfserver | 2 +- Left4Dead/l4dserver | 2 +- Left4Dead2/l4d2server | 2 +- Minecraft/mcserver | 2 +- MultiTheftAuto/mtaserver | 2 +- Mumble/mumbleserver | 2 +- NS2Combat/ns2cserver | 2 +- NaturalSelection2/ns2server | 2 +- NoMoreRoomInHell/nmrihserver | 2 +- OpposingForce/opforserver | 2 +- PiratesVikingandKnightsII/pvkiiserver | 2 +- ProjectCars/pcserver | 2 +- ProjectZomboid/pzserver | 2 +- Quake2/q2server | 2 +- Quake3/q3server | 2 +- QuakeLive/qlserver | 2 +- QuakeWorld/qwserver | 2 +- RedOrchestra/roserver | 2 +- Ricochet/ricochetserver | 2 +- Rust/rustserver | 2 +- SeriousSam3BFE/ss3sserver | 2 +- Starbound/sbserver | 2 +- SvenCoop/svenserver | 2 +- TeamFortress2/tf2server | 2 +- TeamFortressClassic/tfcserver | 2 +- TeamSpeak3/ts3server | 2 +- Teeworlds/twserver | 2 +- Terraria/terrariaserver | 2 +- TowerUnite/tuserver | 2 +- UnrealTournament/utserver | 2 +- UnrealTournament2004/ut2k4server | 2 +- UnrealTournament3/ut3server | 2 +- UnrealTournament99/ut99server | 2 +- WolfensteinEnemyTerritory/wetserver | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_ts3server.sh | 2 +- 71 files changed, 71 insertions(+), 71 deletions(-) diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index ce73f795c..59bbbe252 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index a633d728c..566b9e36a 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Arma3/arma3server b/Arma3/arma3server index 928b2a144..0da13b5a6 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/BallisticOverkill/boserver b/BallisticOverkill/boserver index 781fc4af7..fb15b0be5 100644 --- a/BallisticOverkill/boserver +++ b/BallisticOverkill/boserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server index 3111d79d6..10910c229 100644 --- a/Battlefield1942/bf1942server +++ b/Battlefield1942/bf1942server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index a3e1e9454..01d338c52 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index 470221666..ceb2b6cc3 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index e01b9dbb8..d9f9ad56a 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CallOfDuty/codserver b/CallOfDuty/codserver index 788db3838..ff392d35a 100755 --- a/CallOfDuty/codserver +++ b/CallOfDuty/codserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CallOfDuty2/cod2server b/CallOfDuty2/cod2server index 21481bef6..951157bd2 100755 --- a/CallOfDuty2/cod2server +++ b/CallOfDuty2/cod2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CallOfDuty4/cod4server b/CallOfDuty4/cod4server index 4c0c79a65..153bee61d 100644 --- a/CallOfDuty4/cod4server +++ b/CallOfDuty4/cod4server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CallOfDutyUnitedOffensive/coduoserver b/CallOfDutyUnitedOffensive/coduoserver index bc6b8eaf7..3812bc518 100755 --- a/CallOfDutyUnitedOffensive/coduoserver +++ b/CallOfDutyUnitedOffensive/coduoserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CallOfDutyWorldAtWar/codwawserver b/CallOfDutyWorldAtWar/codwawserver index a8a9204cb..4a026bd22 100755 --- a/CallOfDutyWorldAtWar/codwawserver +++ b/CallOfDutyWorldAtWar/codwawserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver index 63ca1091c..2bcbe44e2 100644 --- a/CodenameCURE/ccserver +++ b/CodenameCURE/ccserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 21a61c540..d19f29285 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 4047c9128..55d29b4ec 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index f3954640c..6fc6ed076 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index af7191cc9..282e7a613 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index e58597264..df059fe0f 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index 9a0009754..d741b5bd6 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/DayOfInfamy/doiserver b/DayOfInfamy/doiserver index 27de57e53..48d51dbc1 100644 --- a/DayOfInfamy/doiserver +++ b/DayOfInfamy/doiserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index bd7540d3c..15e7e06f6 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index 84db9996f..99d8bd167 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index 4bbb6795c..5266942b5 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/EmpiresMod/emserver b/EmpiresMod/emserver index 929405368..bf9cd399e 100644 --- a/EmpiresMod/emserver +++ b/EmpiresMod/emserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Factorio/fctrserver b/Factorio/fctrserver index 890562fa9..e957c8151 100644 --- a/Factorio/fctrserver +++ b/Factorio/fctrserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index 064b1504a..1243f068a 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index 70c535bfd..7da80c97a 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver index 0e3f44e64..9a212cafe 100644 --- a/GoldenEyeSource/gesserver +++ b/GoldenEyeSource/gesserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index a1830b9e7..fd2e79335 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index be1fa33ee..a54c26bc7 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index efec28f28..813ca531e 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index d43cf4114..8b5d31ae7 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Insurgency/insserver b/Insurgency/insserver index 568da1b1f..778e3b99b 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/JustCause2/jc2server b/JustCause2/jc2server index db5974e42..ca23c1640 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index da9de5d3c..d490be6a1 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index 325ee5af9..fb21485b2 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index 9097ee97b..ccf44fd8e 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Minecraft/mcserver b/Minecraft/mcserver index 49bed4183..073a47c74 100644 --- a/Minecraft/mcserver +++ b/Minecraft/mcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/MultiTheftAuto/mtaserver b/MultiTheftAuto/mtaserver index 74111e97c..ad1ed8474 100644 --- a/MultiTheftAuto/mtaserver +++ b/MultiTheftAuto/mtaserver @@ -12,7 +12,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index d66ec7d85..d6b340fcf 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index 04c73b2ed..e56b588af 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index b718a8180..3ae2df8d2 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 5a3318e3e..ccb665c29 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index 0b113a03d..a0b4f9e95 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index 51c0fc434..f9362f998 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/ProjectCars/pcserver b/ProjectCars/pcserver index b05dec06f..c42f2f9ff 100755 --- a/ProjectCars/pcserver +++ b/ProjectCars/pcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 92c02a44c..36aafdae9 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Quake2/q2server b/Quake2/q2server index ff20eaa74..d0441aded 100644 --- a/Quake2/q2server +++ b/Quake2/q2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Quake3/q3server b/Quake3/q3server index b39697eef..8ac52796b 100644 --- a/Quake3/q3server +++ b/Quake3/q3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver index b2ae067f4..0a16e6ff4 100755 --- a/QuakeLive/qlserver +++ b/QuakeLive/qlserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/QuakeWorld/qwserver b/QuakeWorld/qwserver index 147d65127..c3793ed30 100644 --- a/QuakeWorld/qwserver +++ b/QuakeWorld/qwserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index 1c7fac367..84dfc8acd 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index 2a714cc5d..4d4d2cb57 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Rust/rustserver b/Rust/rustserver index 05355eb8c..79e96d80b 100644 --- a/Rust/rustserver +++ b/Rust/rustserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver index c3db06006..d982bd953 100644 --- a/SeriousSam3BFE/ss3sserver +++ b/SeriousSam3BFE/ss3sserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Starbound/sbserver b/Starbound/sbserver index 6672a4f85..64093c6d1 100644 --- a/Starbound/sbserver +++ b/Starbound/sbserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/SvenCoop/svenserver b/SvenCoop/svenserver index 17348c8a9..0aa31d4c2 100644 --- a/SvenCoop/svenserver +++ b/SvenCoop/svenserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index 6a5461090..5a6d16702 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index caabf8bf8..3c51077a2 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index 0cae571ca..25337132e 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Teeworlds/twserver b/Teeworlds/twserver index 377c70088..d1185e84d 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver index 43abf5a97..6aca08117 100644 --- a/Terraria/terrariaserver +++ b/Terraria/terrariaserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/TowerUnite/tuserver b/TowerUnite/tuserver index 500ec01ff..9f15c39a6 100644 --- a/TowerUnite/tuserver +++ b/TowerUnite/tuserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver index 2982a1d7d..f8039d725 100644 --- a/UnrealTournament/utserver +++ b/UnrealTournament/utserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index b5aae27ff..2b89df457 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server index 4ad601283..c8d769038 100644 --- a/UnrealTournament3/ut3server +++ b/UnrealTournament3/ut3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index 002b0efe9..e1b11d313 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/WolfensteinEnemyTerritory/wetserver b/WolfensteinEnemyTerritory/wetserver index 9720fcd98..c3c91a3cb 100644 --- a/WolfensteinEnemyTerritory/wetserver +++ b/WolfensteinEnemyTerritory/wetserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index aa6362168..78ff0804e 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -17,7 +17,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 0b62e3668..0eeab7cb5 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="170219" +version="1700305" ########################## ######## Settings ######## From 7f2440796391279674f2e527836716920eaedbff Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 7 Mar 2017 21:20:29 +0000 Subject: [PATCH 102/102] Release 170305 --- 7DaysToDie/sdtdserver | 2 +- ARKSurvivalEvolved/arkserver | 2 +- Arma3/arma3server | 2 +- BallisticOverkill/boserver | 2 +- Battlefield1942/bf1942server | 2 +- BlackMesa/bmdmserver | 2 +- BladeSymphony/bsserver | 2 +- BrainBread2/bb2server | 2 +- CallOfDuty/codserver | 2 +- CallOfDuty2/cod2server | 2 +- CallOfDuty4/cod4server | 2 +- CallOfDutyUnitedOffensive/coduoserver | 2 +- CallOfDutyWorldAtWar/codwawserver | 2 +- CodenameCURE/ccserver | 2 +- CounterStrike/csserver | 2 +- CounterStrikeConditionZero/csczserver | 2 +- CounterStrikeGlobalOffensive/csgoserver | 2 +- CounterStrikeSource/cssserver | 2 +- DayOfDefeat/dodserver | 2 +- DayOfDefeatSource/dodsserver | 2 +- DayOfInfamy/doiserver | 2 +- DeathmatchClassic/dmcserver | 2 +- DontStarveTogether/dstserver | 2 +- DoubleActionBoogaloo/dabserver | 2 +- EmpiresMod/emserver | 2 +- Factorio/fctrserver | 2 +- FistfulOfFrags/fofserver | 2 +- GarrysMod/gmodserver | 2 +- GoldenEyeSource/gesserver | 2 +- HalfLife2Deathmatch/hl2dmserver | 2 +- HalfLifeDeathmatch/hldmserver | 2 +- HalfLifeDeathmatchSource/hldmsserver | 2 +- Hurtworld/hwserver | 2 +- Insurgency/insserver | 2 +- JustCause2/jc2server | 2 +- KillingFloor/kfserver | 2 +- Left4Dead/l4dserver | 2 +- Left4Dead2/l4d2server | 2 +- Minecraft/mcserver | 2 +- MultiTheftAuto/mtaserver | 2 +- Mumble/mumbleserver | 2 +- NS2Combat/ns2cserver | 2 +- NaturalSelection2/ns2server | 2 +- NoMoreRoomInHell/nmrihserver | 2 +- OpposingForce/opforserver | 2 +- PiratesVikingandKnightsII/pvkiiserver | 2 +- ProjectCars/pcserver | 2 +- ProjectZomboid/pzserver | 2 +- Quake2/q2server | 2 +- Quake3/q3server | 2 +- QuakeLive/qlserver | 2 +- QuakeWorld/qwserver | 2 +- RedOrchestra/roserver | 2 +- Ricochet/ricochetserver | 2 +- Rust/rustserver | 2 +- SeriousSam3BFE/ss3sserver | 2 +- Starbound/sbserver | 2 +- SvenCoop/svenserver | 2 +- TeamFortress2/tf2server | 2 +- TeamFortressClassic/tfcserver | 2 +- TeamSpeak3/ts3server | 2 +- Teeworlds/twserver | 2 +- Terraria/terrariaserver | 2 +- TowerUnite/tuserver | 2 +- UnrealTournament/utserver | 2 +- UnrealTournament2004/ut2k4server | 2 +- UnrealTournament3/ut3server | 2 +- UnrealTournament99/ut99server | 2 +- WolfensteinEnemyTerritory/wetserver | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_ts3server.sh | 2 +- 71 files changed, 71 insertions(+), 71 deletions(-) diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index 59bbbe252..fe579d3df 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 566b9e36a..6770d4128 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Arma3/arma3server b/Arma3/arma3server index 0da13b5a6..4b7d9e90e 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/BallisticOverkill/boserver b/BallisticOverkill/boserver index fb15b0be5..1f29990be 100644 --- a/BallisticOverkill/boserver +++ b/BallisticOverkill/boserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server index 10910c229..efd27a892 100644 --- a/Battlefield1942/bf1942server +++ b/Battlefield1942/bf1942server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index 01d338c52..29d4cb903 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index ceb2b6cc3..96c27899e 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index d9f9ad56a..3647d5a32 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CallOfDuty/codserver b/CallOfDuty/codserver index ff392d35a..f4d092300 100755 --- a/CallOfDuty/codserver +++ b/CallOfDuty/codserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CallOfDuty2/cod2server b/CallOfDuty2/cod2server index 951157bd2..9b918fc1b 100755 --- a/CallOfDuty2/cod2server +++ b/CallOfDuty2/cod2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CallOfDuty4/cod4server b/CallOfDuty4/cod4server index 153bee61d..50432244f 100644 --- a/CallOfDuty4/cod4server +++ b/CallOfDuty4/cod4server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CallOfDutyUnitedOffensive/coduoserver b/CallOfDutyUnitedOffensive/coduoserver index 3812bc518..9011ead88 100755 --- a/CallOfDutyUnitedOffensive/coduoserver +++ b/CallOfDutyUnitedOffensive/coduoserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CallOfDutyWorldAtWar/codwawserver b/CallOfDutyWorldAtWar/codwawserver index 4a026bd22..81bac8ca1 100755 --- a/CallOfDutyWorldAtWar/codwawserver +++ b/CallOfDutyWorldAtWar/codwawserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver index 2bcbe44e2..15a57e0af 100644 --- a/CodenameCURE/ccserver +++ b/CodenameCURE/ccserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CounterStrike/csserver b/CounterStrike/csserver index d19f29285..ac18e4e20 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 55d29b4ec..d02caa924 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index 6fc6ed076..75ffa7265 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 282e7a613..7ccc2a688 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index df059fe0f..17e6bf90a 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index d741b5bd6..6710ec756 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/DayOfInfamy/doiserver b/DayOfInfamy/doiserver index 48d51dbc1..e26f95010 100644 --- a/DayOfInfamy/doiserver +++ b/DayOfInfamy/doiserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index 15e7e06f6..9308ced64 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index 99d8bd167..d84b8084a 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index 5266942b5..ab0f3c770 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/EmpiresMod/emserver b/EmpiresMod/emserver index bf9cd399e..a9b9def1c 100644 --- a/EmpiresMod/emserver +++ b/EmpiresMod/emserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Factorio/fctrserver b/Factorio/fctrserver index e957c8151..54e76a5f2 100644 --- a/Factorio/fctrserver +++ b/Factorio/fctrserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index 1243f068a..aaf73016c 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index 7da80c97a..d9b06c24a 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver index 9a212cafe..9182365d6 100644 --- a/GoldenEyeSource/gesserver +++ b/GoldenEyeSource/gesserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index fd2e79335..a32f50903 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index a54c26bc7..701678eb9 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index 813ca531e..aa5a19990 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 8b5d31ae7..445551956 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Insurgency/insserver b/Insurgency/insserver index 778e3b99b..6bf8c6787 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/JustCause2/jc2server b/JustCause2/jc2server index ca23c1640..f6491db66 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index d490be6a1..cd3d4c8d8 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index fb21485b2..fae715724 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index ccf44fd8e..8b9761476 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Minecraft/mcserver b/Minecraft/mcserver index 073a47c74..5e703eec3 100644 --- a/Minecraft/mcserver +++ b/Minecraft/mcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/MultiTheftAuto/mtaserver b/MultiTheftAuto/mtaserver index ad1ed8474..328e5886b 100644 --- a/MultiTheftAuto/mtaserver +++ b/MultiTheftAuto/mtaserver @@ -12,7 +12,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index d6b340fcf..369a26206 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index e56b588af..c5abeb46f 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index 3ae2df8d2..af5e65d24 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index ccb665c29..7aac993bc 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index a0b4f9e95..915a6944a 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index f9362f998..5ab0e2396 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/ProjectCars/pcserver b/ProjectCars/pcserver index c42f2f9ff..64b6bd5e8 100755 --- a/ProjectCars/pcserver +++ b/ProjectCars/pcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 36aafdae9..191505d57 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Quake2/q2server b/Quake2/q2server index d0441aded..601fff1cc 100644 --- a/Quake2/q2server +++ b/Quake2/q2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Quake3/q3server b/Quake3/q3server index 8ac52796b..9a0dced71 100644 --- a/Quake3/q3server +++ b/Quake3/q3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver index 0a16e6ff4..1fdaec287 100755 --- a/QuakeLive/qlserver +++ b/QuakeLive/qlserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/QuakeWorld/qwserver b/QuakeWorld/qwserver index c3793ed30..5d0cb3b8a 100644 --- a/QuakeWorld/qwserver +++ b/QuakeWorld/qwserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index 84dfc8acd..ea82680d5 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index 4d4d2cb57..641fc84e1 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Rust/rustserver b/Rust/rustserver index 79e96d80b..6ac1ac5f9 100644 --- a/Rust/rustserver +++ b/Rust/rustserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver index d982bd953..a6b4d53f0 100644 --- a/SeriousSam3BFE/ss3sserver +++ b/SeriousSam3BFE/ss3sserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Starbound/sbserver b/Starbound/sbserver index 64093c6d1..cd7f8c40a 100644 --- a/Starbound/sbserver +++ b/Starbound/sbserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/SvenCoop/svenserver b/SvenCoop/svenserver index 0aa31d4c2..0f6fb9829 100644 --- a/SvenCoop/svenserver +++ b/SvenCoop/svenserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index 5a6d16702..25d262dd3 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index 3c51077a2..834472249 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index 25337132e..f5a39f220 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Teeworlds/twserver b/Teeworlds/twserver index d1185e84d..0325f3889 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver index 6aca08117..f0a893134 100644 --- a/Terraria/terrariaserver +++ b/Terraria/terrariaserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/TowerUnite/tuserver b/TowerUnite/tuserver index 9f15c39a6..eb356d6fd 100644 --- a/TowerUnite/tuserver +++ b/TowerUnite/tuserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver index f8039d725..055f689bc 100644 --- a/UnrealTournament/utserver +++ b/UnrealTournament/utserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index 2b89df457..760efbf53 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server index c8d769038..369b7e643 100644 --- a/UnrealTournament3/ut3server +++ b/UnrealTournament3/ut3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index e1b11d313..e1fa68fb3 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/WolfensteinEnemyTerritory/wetserver b/WolfensteinEnemyTerritory/wetserver index c3c91a3cb..22ef30bd0 100644 --- a/WolfensteinEnemyTerritory/wetserver +++ b/WolfensteinEnemyTerritory/wetserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 78ff0804e..360345341 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -17,7 +17,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ######## diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 0eeab7cb5..e2bf7b12d 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="1700305" +version="170305" ########################## ######## Settings ########