From e86691d94f1f64cf0a9c90ef255940f9a783ceeb Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 23:44:40 +0200 Subject: [PATCH 01/61] Added mumble update --- lgsm/functions/command_update.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index e0fde4a0b..83a797f7d 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -15,8 +15,10 @@ check.sh if [ "${gamename}" == "Teamspeak 3" ]; then update_ts3.sh +elif [ "${gamename}" == "Mumble" ]; then + update_mumble.sh else update_steamcmd.sh fi -core_exit.sh \ No newline at end of file +core_exit.sh From 93780b5cdb6fffa12f4811b5bdbb00db8cd38839 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 23:51:25 +0200 Subject: [PATCH 02/61] Added mumble --- lgsm/functions/install_server_files.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index d881a2717..c1f1b9f07 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -94,6 +94,8 @@ sleep 1 if [ "${gamename}" == "Teamspeak 3" ]; then update_ts3.sh +elif [ "${gamename}" == "Mumble" ]; then + update_mumble.sh elif [ -z "${appid}" ]||[ "${gamename}" == "GoldenEye: Source" ]; then fn_install_server_files fi From a1dc72586f3f56f892045f073628e20b3d0226ce Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 23:52:31 +0200 Subject: [PATCH 03/61] Added mumble --- lgsm/functions/core_functions.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index e89b18fe7..f4e85e2d3 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -380,6 +380,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +update_mumble.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + update_steamcmd.sh(){ functionfile="${FUNCNAME}" fn_fetch_function From 3891f80b8efac747a5d513f444953f75a1f6d922 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 23:54:50 +0200 Subject: [PATCH 04/61] Updated mumble commands --- lgsm/functions/core_getopt.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 772a5a4b3..d7939ead7 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -138,20 +138,24 @@ case "${getopt}" in 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;; et|test-alert) command_test_alert.sh;; + dt|details) + command_details.sh;; b|backup) command_backup.sh;; + pw|change-password) + command_ts3_server_pass.sh;; dev|dev-debug) command_dev_debug.sh;; - console) - command_console.sh;; - d|debug) - command_debug.sh;; + i|install) + command_install.sh;; dd|depsdetect) command_dev_detect_deps.sh;; *) @@ -168,12 +172,14 @@ case "${getopt}" in 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}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}change-password\t${default}pw |Changes TS3 serveradmin password." 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." } | column -s $'\t' -t esac } @@ -460,4 +466,4 @@ elif [ "${engine}" == "unreal" ]; then else fn_getopt_generic fi -core_exit.sh \ No newline at end of file +core_exit.sh From d471c90bece1d5b2ea2f35378292b0eaca601b77 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 01:52:32 +0200 Subject: [PATCH 05/61] First shot for mumble install and update --- lgsm/functions/update_mumble.sh | 172 ++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 lgsm/functions/update_mumble.sh diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh new file mode 100644 index 000000000..fa9cbf7f1 --- /dev/null +++ b/lgsm/functions/update_mumble.sh @@ -0,0 +1,172 @@ +#!/bin/bash +# LGSM update_mumble.sh function +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://gameservermanagers.com +# Description: Handles updating of mumble servers. + +local commandname="UPDATE" +local commandaction="Update" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" + +fn_update_mumble_arch(){ +# Mumble is x86 only for now +mumblearch="x86" +} + +fn_update_mumble_availablebuild(){ +# Gets available build info. +fn_print_info_nl "Checking for update from github.com" +fn_script_log "Checking for update from github.com" +availablebuild=$(curl -s https://api.github.com/repos/mumble-voip/mumble/releases/latest | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') +sleep 1 + +# Checks if availablebuild variable has been set +if [ -z "${availablebuild}" ]; then + fn_print_fail "Checking for update from github.com" + sleep 1 + fn_print_fail "Checking for update: github.com: Not returning version info" + fn_script_log_fatal "Failure! Checking for update: github.com Not returning version info" + core_exit.sh +else + fn_print_ok_nl "Checking for update from github.com" + fn_script_log_pass "Checking for update from github.com" + sleep 1 +fi +} + +fn_update_mumble_currentbuild(){ +# Gets current build info +fn_print_info "Checking current server build" +sleep 1 + # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. + if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then + fn_print_info_nl "No current log found, can't retrieve current server build" + fn_script_log_info "No current log found, can't retrieve current server build" + sleep 1 + fn_print_info_nl "Forcing server restart" + fn_script_log_info "Forcing server restart" + sleep 1 + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + sleep 1 + # Check again and exit on failure. + if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then + fn_print_fail_nl "Still no logs found, can't retrieve server version + fn_script_log_fatal "Still no logs found, can't retrieve server version" + core_exit.sh + else + fn_print_ok_nl "Logs found" + fn_script_log "Logs found" + sleep 1 + fi + fi + +# Get current build from logs +currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') + + if [ -z "${currentbuild}" ]; then + fn_print_info_nl "Can't find current build version in logs" + fn_script_log_error "Can't find current build version in logs" + sleep 1 + fn_print_info_nl "Forcing server restart" + fn_script_log_info "Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') + if [ -z "${currentbuild}" ]; then + fn_print_fail_nl "Sorry, current build version still not found" + fn_script_log_fatal "Sorry, current build version still not found" + core_exit.sh + fi + fi +} + +fn_update_mumble_compare(){ + # Removes dots so if can compare version numbers + currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') + availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') + + if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then + echo -e "\n" + echo -e "Update available:" + sleep 1 + echo -e " Current build: ${red}${currentbuild} ${architecture}${default}" + echo -e " Available build: ${green}${availablebuild} ${architecture}${default}" + echo -e "" + sleep 1 + echo "" + echo -en "Applying update.\r" + sleep 1 + echo -en "Applying update..\r" + sleep 1 + echo -en "Applying update...\r" + sleep 1 + echo -en "\n" + fn_script_log "Update available" + fn_script_log "Current build: ${currentbuild}" + fn_script_log "Available build: ${availablebuild}" + fn_script_log "${currentbuild} > ${availablebuild}" + + unset updateonstart + + check_status.sh + if [ "${status}" == "0" ]; then + fn_update_mumble_dl + exitbypass=1 + command_start.sh + exitbypass=1 + command_stop.sh + else + exitbypass=1 + command_stop.sh + fn_update_mumble_dl + exitbypass=1 + command_start.sh + fi + alert="update" + alert.sh + else + echo -e "\n" + echo -e "No update available:" + echo -e " Current version: ${green}${currentbuild}${default}" + echo -e " Available version: ${green}${availablebuild}${default}" + echo -e "" + fn_print_ok_nl "No update available" + fn_script_log_info "Current build: ${currentbuild}" + fn_script_log_info "Available build: ${availablebuild}" + fi +} + +fn_update_mumble_dl(){ + mumblefilename="murmur-static_${mumblearch}-${mumble_version_number}.tar.bz2" + fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblefilename}" "${lgsmdir}/tmp" "${mumblefilename}" + fn_dl_extract "${lgsmdir}/tmp" "${mumblefilename}" "${lgsmdir}/tmp" + echo -e "copying to ${filesdir}...\c" + fn_script_log "Copying to ${filesdir}" + cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${mumble_version_number}/"* "${filesdir}" + local exitcode=$? + if [ ${exitcode} -eq 0 ]; then + fn_print_ok_eol_nl + else + fn_print_fail_eol_nl + fi +} + +fn_update_mubmle_arch +if [ "${installer}" == "1" ]; then + fn_update_ts3_availablebuild + fn_update_ts3_dl +else + # Checks for server update from teamspeak.com using a mirror dl.4players.de. + fn_print_dots "Checking for update: teamspeak.com" + fn_script_log_info "Checking for update: teamspeak.com" + sleep 1 + fn_update_ts3_currentbuild + fn_update_ts3_availablebuild + fn_update_ts3_compare +fi From 0c876d4724b00140608eff8c3fcbbff59b388eb7 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 01:59:02 +0200 Subject: [PATCH 06/61] Functions naming --- lgsm/functions/update_mumble.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index fa9cbf7f1..a06218f68 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -159,14 +159,14 @@ fn_update_mumble_dl(){ fn_update_mubmle_arch if [ "${installer}" == "1" ]; then - fn_update_ts3_availablebuild - fn_update_ts3_dl + fn_update_mumble_availablebuild + fn_update_mumble_dl else # Checks for server update from teamspeak.com using a mirror dl.4players.de. - fn_print_dots "Checking for update: teamspeak.com" - fn_script_log_info "Checking for update: teamspeak.com" + fn_print_dots "Checking for update: github.com" + fn_script_log_info "Checking for update: github.com" sleep 1 - fn_update_ts3_currentbuild - fn_update_ts3_availablebuild - fn_update_ts3_compare + fn_update_mumble_currentbuild + fn_update_mumble_availablebuild + fn_update_mumble_compare fi From 3eca60b1a7782754adac4e74ba61b1c859c0cbbd Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 02:09:33 +0200 Subject: [PATCH 07/61] Added mumble installation --- lgsm/functions/command_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index 6d2bcf40e..79fede4a0 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -17,7 +17,7 @@ check_deps.sh if [ "${gamename}" == "Unreal Tournament 2004" ]; then install_server_files.sh install_ut2k4_key.sh -elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Teamspeak 3" ]||[ "${gamename}" == "Mumble" ]; then installer=1 install_server_files.sh elif [ -n "${appid}" ]; then @@ -35,4 +35,4 @@ fi fix.sh install_complete.sh -core_exit.sh \ No newline at end of file +core_exit.sh From a289e4d574a71a3180d6bb7330a4df30b919ad56 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 02:15:28 +0200 Subject: [PATCH 08/61] Spacing and quote --- lgsm/functions/update_mumble.sh | 194 ++++++++++++++++---------------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index a06218f68..9f0e6ecb9 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -39,122 +39,122 @@ fn_update_mumble_currentbuild(){ # Gets current build info fn_print_info "Checking current server build" sleep 1 - # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. +# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. +if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then + fn_print_info_nl "No current log found, can't retrieve current server build" + fn_script_log_info "No current log found, can't retrieve current server build" + sleep 1 + fn_print_info_nl "Forcing server restart" + fn_script_log_info "Forcing server restart" + sleep 1 + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + sleep 1 + # Check again and exit on failure. if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then - fn_print_info_nl "No current log found, can't retrieve current server build" - fn_script_log_info "No current log found, can't retrieve current server build" - sleep 1 - fn_print_info_nl "Forcing server restart" - fn_script_log_info "Forcing server restart" - sleep 1 - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - sleep 1 - # Check again and exit on failure. - if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then - fn_print_fail_nl "Still no logs found, can't retrieve server version - fn_script_log_fatal "Still no logs found, can't retrieve server version" - core_exit.sh - else - fn_print_ok_nl "Logs found" - fn_script_log "Logs found" - sleep 1 - fi + fn_print_fail_nl "Still no logs found, cannot retrieve server version" + fn_script_log_fatal "Still no logs found, cannot retrieve server version" + core_exit.sh + else + fn_print_ok_nl "Logs found" + fn_script_log "Logs found" + sleep 1 fi +fi # Get current build from logs currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') +if [ -z "${currentbuild}" ]; then + fn_print_info_nl "Can't find current build version in logs" + fn_script_log_error "Can't find current build version in logs" + sleep 1 + fn_print_info_nl "Forcing server restart" + fn_script_log_info "Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') if [ -z "${currentbuild}" ]; then - fn_print_info_nl "Can't find current build version in logs" - fn_script_log_error "Can't find current build version in logs" - sleep 1 - fn_print_info_nl "Forcing server restart" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') - if [ -z "${currentbuild}" ]; then - fn_print_fail_nl "Sorry, current build version still not found" - fn_script_log_fatal "Sorry, current build version still not found" - core_exit.sh - fi + fn_print_fail_nl "Sorry, current build version still not found" + fn_script_log_fatal "Sorry, current build version still not found" + core_exit.sh fi +fi } fn_update_mumble_compare(){ - # Removes dots so if can compare version numbers - currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') - availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') +# Removes dots so if can compare version numbers +currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') +availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') - if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then - echo -e "\n" - echo -e "Update available:" - sleep 1 - echo -e " Current build: ${red}${currentbuild} ${architecture}${default}" - echo -e " Available build: ${green}${availablebuild} ${architecture}${default}" - echo -e "" - sleep 1 - echo "" - echo -en "Applying update.\r" - sleep 1 - echo -en "Applying update..\r" - sleep 1 - echo -en "Applying update...\r" - sleep 1 - echo -en "\n" - fn_script_log "Update available" - fn_script_log "Current build: ${currentbuild}" - fn_script_log "Available build: ${availablebuild}" - fn_script_log "${currentbuild} > ${availablebuild}" +if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then + echo -e "\n" + echo -e "Update available:" + sleep 1 + echo -e " Current build: ${red}${currentbuild} ${architecture}${default}" + echo -e " Available build: ${green}${availablebuild} ${architecture}${default}" + echo -e "" + sleep 1 + echo "" + echo -en "Applying update.\r" + sleep 1 + echo -en "Applying update..\r" + sleep 1 + echo -en "Applying update...\r" + sleep 1 + echo -en "\n" + fn_script_log "Update available" + fn_script_log "Current build: ${currentbuild}" + fn_script_log "Available build: ${availablebuild}" + fn_script_log "${currentbuild} > ${availablebuild}" - unset updateonstart + unset updateonstart - check_status.sh - if [ "${status}" == "0" ]; then - fn_update_mumble_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh - else - exitbypass=1 - command_stop.sh - fn_update_mumble_dl - exitbypass=1 - command_start.sh - fi - alert="update" - alert.sh + check_status.sh + if [ "${status}" == "0" ]; then + fn_update_mumble_dl + exitbypass=1 + command_start.sh + exitbypass=1 + command_stop.sh else - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: ${green}${currentbuild}${default}" - echo -e " Available version: ${green}${availablebuild}${default}" - echo -e "" - fn_print_ok_nl "No update available" - fn_script_log_info "Current build: ${currentbuild}" - fn_script_log_info "Available build: ${availablebuild}" + exitbypass=1 + command_stop.sh + fn_update_mumble_dl + exitbypass=1 + command_start.sh fi + alert="update" + alert.sh +else + echo -e "\n" + echo -e "No update available:" + echo -e " Current version: ${green}${currentbuild}${default}" + echo -e " Available version: ${green}${availablebuild}${default}" + echo -e "" + fn_print_ok_nl "No update available" + fn_script_log_info "Current build: ${currentbuild}" + fn_script_log_info "Available build: ${availablebuild}" +fi } fn_update_mumble_dl(){ - mumblefilename="murmur-static_${mumblearch}-${mumble_version_number}.tar.bz2" - fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblefilename}" "${lgsmdir}/tmp" "${mumblefilename}" - fn_dl_extract "${lgsmdir}/tmp" "${mumblefilename}" "${lgsmdir}/tmp" - echo -e "copying to ${filesdir}...\c" - fn_script_log "Copying to ${filesdir}" - cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${mumble_version_number}/"* "${filesdir}" - local exitcode=$? - if [ ${exitcode} -eq 0 ]; then - fn_print_ok_eol_nl - else - fn_print_fail_eol_nl - fi +mumblefilename="murmur-static_${mumblearch}-${mumble_version_number}.tar.bz2" +fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblefilename}" "${lgsmdir}/tmp" "${mumblefilename}" +fn_dl_extract "${lgsmdir}/tmp" "${mumblefilename}" "${lgsmdir}/tmp" +echo -e "copying to ${filesdir}...\c" +fn_script_log "Copying to ${filesdir}" +cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${mumble_version_number}/"* "${filesdir}" +local exitcode=$? +if [ ${exitcode} -eq 0 ]; then + fn_print_ok_eol_nl +else + fn_print_fail_eol_nl +fi } fn_update_mubmle_arch From 72dfe2086abf7ed90c9183f8aa76055839665dee Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 02:24:38 +0200 Subject: [PATCH 09/61] Fixes --- lgsm/functions/update_mumble.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 9f0e6ecb9..8613567bf 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -143,12 +143,16 @@ fi } fn_update_mumble_dl(){ -mumblefilename="murmur-static_${mumblearch}-${mumble_version_number}.tar.bz2" -fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblefilename}" "${lgsmdir}/tmp" "${mumblefilename}" -fn_dl_extract "${lgsmdir}/tmp" "${mumblefilename}" "${lgsmdir}/tmp" +mumblebuildname="murmur-static_${mumblearch}-${availablebuild}" +if [ ! -f "${lgsmdir}/tmp" ]; then + mkdir ${lgsmdir}/tmp +fi +fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" +fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}" "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" -cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${mumble_version_number}/"* "${filesdir}" +cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${availablebuild}/"* "${filesdir}" +rm -R ${lgsmdir}/tmp local exitcode=$? if [ ${exitcode} -eq 0 ]; then fn_print_ok_eol_nl @@ -157,7 +161,7 @@ else fi } -fn_update_mubmle_arch +fn_update_mumble_arch if [ "${installer}" == "1" ]; then fn_update_mumble_availablebuild fn_update_mumble_dl From 77d401ef1b92cd6b576faf94f51497c4c173ba9f Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 02:35:48 +0200 Subject: [PATCH 10/61] corrected folder name and redundant quotes --- lgsm/functions/update_mumble.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 8613567bf..d10683dc2 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -40,7 +40,7 @@ fn_update_mumble_currentbuild(){ fn_print_info "Checking current server build" sleep 1 # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. -if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then +if [ ! -f "${consolelogdir}"/"${servicename}"-console.log ]; then fn_print_info_nl "No current log found, can't retrieve current server build" fn_script_log_info "No current log found, can't retrieve current server build" sleep 1 @@ -53,7 +53,7 @@ if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then command_start.sh sleep 1 # Check again and exit on failure. - if [ ! -f ""${consolelogdir}"/"${servicename}"-console.log" ]; then + if [ ! -f ${consolelogdir}"/"${servicename}"-console.log ]; then fn_print_fail_nl "Still no logs found, cannot retrieve server version" fn_script_log_fatal "Still no logs found, cannot retrieve server version" core_exit.sh @@ -151,7 +151,7 @@ fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumbleb fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}" "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" -cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${availablebuild}/"* "${filesdir}" +cp -R "${lgsmdir}/tmp/${mumblebuildname}/"* "${filesdir}" rm -R ${lgsmdir}/tmp local exitcode=$? if [ ${exitcode} -eq 0 ]; then From 72f87c955efe38a955fde6041d156596c8b37b64 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 02:40:33 +0200 Subject: [PATCH 11/61] quotes again & correction --- lgsm/functions/update_mumble.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index d10683dc2..9e9f62bf6 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -40,7 +40,7 @@ fn_update_mumble_currentbuild(){ fn_print_info "Checking current server build" sleep 1 # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. -if [ ! -f "${consolelogdir}"/"${servicename}"-console.log ]; then +if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then fn_print_info_nl "No current log found, can't retrieve current server build" fn_script_log_info "No current log found, can't retrieve current server build" sleep 1 @@ -53,7 +53,7 @@ if [ ! -f "${consolelogdir}"/"${servicename}"-console.log ]; then command_start.sh sleep 1 # Check again and exit on failure. - if [ ! -f ${consolelogdir}"/"${servicename}"-console.log ]; then + if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then fn_print_fail_nl "Still no logs found, cannot retrieve server version" fn_script_log_fatal "Still no logs found, cannot retrieve server version" core_exit.sh @@ -95,8 +95,8 @@ if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then echo -e "\n" echo -e "Update available:" sleep 1 - echo -e " Current build: ${red}${currentbuild} ${architecture}${default}" - echo -e " Available build: ${green}${availablebuild} ${architecture}${default}" + echo -e " Current build: ${red}${currentbuild} ${mumblearch}${default}" + echo -e " Available build: ${green}${availablebuild} ${mumblearch}${default}" echo -e "" sleep 1 echo "" @@ -145,14 +145,14 @@ fi fn_update_mumble_dl(){ mumblebuildname="murmur-static_${mumblearch}-${availablebuild}" if [ ! -f "${lgsmdir}/tmp" ]; then - mkdir ${lgsmdir}/tmp + mkdir "${lgsmdir}/tmp" fi fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}" "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" cp -R "${lgsmdir}/tmp/${mumblebuildname}/"* "${filesdir}" -rm -R ${lgsmdir}/tmp +rm -R "${lgsmdir}/tmp" local exitcode=$? if [ ${exitcode} -eq 0 ]; then fn_print_ok_eol_nl From 8dc34f9b51ecb8ec398b95ede6644328cd91cd64 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 02:45:34 +0200 Subject: [PATCH 12/61] missing availablebuild in url --- lgsm/functions/update_mumble.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 9e9f62bf6..9ed857ccf 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -147,7 +147,7 @@ mumblebuildname="murmur-static_${mumblearch}-${availablebuild}" if [ ! -f "${lgsmdir}/tmp" ]; then mkdir "${lgsmdir}/tmp" fi -fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" +fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}" "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" From b1053261903381dca02adfe2237db2b05f54da27 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 02:48:02 +0200 Subject: [PATCH 13/61] missing .tar.bz2 --- lgsm/functions/update_mumble.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 9ed857ccf..691fe0587 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -148,7 +148,7 @@ if [ ! -f "${lgsmdir}/tmp" ]; then mkdir "${lgsmdir}/tmp" fi fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" -fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}" "${lgsmdir}/tmp" +fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}".tar.bz2 "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" cp -R "${lgsmdir}/tmp/${mumblebuildname}/"* "${filesdir}" From f191bb39a9c046dd1ff66537016cfb2a639a9632 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 03:29:04 +0200 Subject: [PATCH 14/61] some fixes, but not enough --- lgsm/functions/update_mumble.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 691fe0587..c8a36c5b3 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -144,11 +144,11 @@ fi fn_update_mumble_dl(){ mumblebuildname="murmur-static_${mumblearch}-${availablebuild}" -if [ ! -f "${lgsmdir}/tmp" ]; then +if [ ! -d "${lgsmdir}/tmp" ]; then mkdir "${lgsmdir}/tmp" fi fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" -fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}".tar.bz2 "${lgsmdir}/tmp" +fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" cp -R "${lgsmdir}/tmp/${mumblebuildname}/"* "${filesdir}" From ce452f58db740c47a01370cf366bbba18e661fa8 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 03:30:21 +0200 Subject: [PATCH 15/61] don't remove files for testing --- lgsm/functions/update_mumble.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index c8a36c5b3..61cb9a3d8 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -152,7 +152,7 @@ fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" cp -R "${lgsmdir}/tmp/${mumblebuildname}/"* "${filesdir}" -rm -R "${lgsmdir}/tmp" +#rm -R "${lgsmdir}/tmp" local exitcode=$? if [ ${exitcode} -eq 0 ]; then fn_print_ok_eol_nl From b0253a9ff555ad71e326e48a6b73fb079511bbec Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 03:49:19 +0200 Subject: [PATCH 16/61] Allow curl to follow redirect (with -L) --- lgsm/functions/core_dl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 2b1ff8053..2a3c196a5 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -117,11 +117,11 @@ fn_fetch_file(){ if [ ${filename##*.} == "bz2" ]; then echo -ne "downloading ${filename}..." sleep 1 - curlcmd=$(${curlcmd} --progress-bar --fail -o "${filedir}/${filename}" "${fileurl}") + curlcmd=$(${curlcmd} --progress-bar --fail -L -o "${filedir}/${filename}" "${fileurl}") echo -ne "downloading ${filename}..." else echo -ne " fetching ${filename}...\c" - curlcmd=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${fileurl}" 2>&1) + curlcmd=$(${curlcmd} -s --fail -L -o "${filedir}/${filename}" "${fileurl}" 2>&1) fi local exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -218,4 +218,4 @@ fn_update_function(){ force="noforce" md5="nomd5" fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" -} \ No newline at end of file +} From 16a90bb3577461777a0294409b61bd2d56374944 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 04:05:06 +0200 Subject: [PATCH 17/61] improvements --- lgsm/functions/update_mumble.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 61cb9a3d8..46cc8ab79 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -15,29 +15,29 @@ mumblearch="x86" } fn_update_mumble_availablebuild(){ -# Gets available build info. -fn_print_info_nl "Checking for update from github.com" -fn_script_log "Checking for update from github.com" +# Gets latest build info. +fn_print_info_nl "Checking latest build from github.com" +fn_script_log "Checking latest build from github.com" availablebuild=$(curl -s https://api.github.com/repos/mumble-voip/mumble/releases/latest | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') sleep 1 # Checks if availablebuild variable has been set if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking for update from github.com" + fn_print_fail "Checking latest build from github.com" sleep 1 - fn_print_fail "Checking for update: github.com: Not returning version info" - fn_script_log_fatal "Failure! Checking for update: github.com Not returning version info" + fn_print_fail "Checking latest build from github.com: Not returning version info" + fn_script_log_fatal "Checking latest build from github.com: Not returning version info" core_exit.sh else - fn_print_ok_nl "Checking for update from github.com" - fn_script_log_pass "Checking for update from github.com" + fn_print_ok_nl "Checked latest build from github.com" + fn_script_log_pass "Checked latest build from github.com" sleep 1 fi } fn_update_mumble_currentbuild(){ # Gets current build info -fn_print_info "Checking current server build" +fn_print_info "Checking installed server build" sleep 1 # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then @@ -47,10 +47,15 @@ if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then fn_print_info_nl "Forcing server restart" fn_script_log_info "Forcing server restart" sleep 1 - exitbypass=1 - command_stop.sh + check_status.sh + if [ "${status}" != "0" ]; then + exitbypass=1 + command_stop.sh + fi exitbypass=1 command_start.sh + exitbypass=1 + command_stopt.sh sleep 1 # Check again and exit on failure. if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then @@ -152,7 +157,7 @@ fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" cp -R "${lgsmdir}/tmp/${mumblebuildname}/"* "${filesdir}" -#rm -R "${lgsmdir}/tmp" +rm -R "${lgsmdir}/tmp" local exitcode=$? if [ ${exitcode} -eq 0 ]; then fn_print_ok_eol_nl @@ -166,7 +171,7 @@ if [ "${installer}" == "1" ]; then fn_update_mumble_availablebuild fn_update_mumble_dl else - # Checks for server update from teamspeak.com using a mirror dl.4players.de. + # Checks for server update from github.com fn_print_dots "Checking for update: github.com" fn_script_log_info "Checking for update: github.com" sleep 1 From 2aa42fc724ce70743d5fc31a2787732449f22d85 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 04:11:59 +0200 Subject: [PATCH 18/61] No glibc for Mumble --- lgsm/functions/info_glibc.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index 2a1adc058..ea4c3a279 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -71,6 +71,9 @@ elif [ "${engine}" == "unity3d" ]; then elif [ "${gamename}" == "Teamspeak 3" ]; then glibcrequired="NOT REQUIRED" glibcfix="no" +elif [ "${gamename}" == "Mumble" ]; then + glibcrequired="NOT REQUIRED" + glibcfix="no" else glibcrequired="UNKNOWN" glibcfix="no" From 8f046e5956e9084f0d67de273f04bc567b3b1862 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 04:25:03 +0200 Subject: [PATCH 19/61] Mumble details --- lgsm/functions/command_details.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 2072835be..751be5d4c 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -286,7 +286,7 @@ fn_details_ports(){ echo -e "Change ports by editing the parameters in:" parmslocation="${red}UNKNOWN${default}" - local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "Teamspeak 3" "7 Days To Die" ) + local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "Teamspeak 3" "Mumble" "7 Days To Die" ) for port_edit in "${ports_edit_array[@]}" do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then @@ -441,6 +441,17 @@ fn_details_teamspeak3(){ } | column -s $'\t' -t } +fn_details_mumble(){ + echo -e "netstat -atunp | grep murmur" + echo -e "" + port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }' + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Voice\tIN&OUT\t${port}\tudp" + echo -e "> ServerQuery\tIN&OUT\t${port}\ttcp" + } | column -s $'\t' -t +} + fn_details_teeworlds(){ echo -e "netstat -atunp | grep teeworlds_srv" echo -e "" @@ -608,6 +619,8 @@ elif [ "${gamename}" == "7 Days To Die" ]; then fn_details_sdtd elif [ "${gamename}" == "Teamspeak 3" ]; then fn_details_teamspeak3 +elif [ "${gamename}" == "Mumble" ]; then + fn_details_mumble elif [ "${gamename}" == "Rust" ]; then fn_details_rust else @@ -615,4 +628,4 @@ else fi fn_details_statusbottom -core_exit.sh \ No newline at end of file +core_exit.sh From aba32001b5999d88ce1a7a95b1ae8979b5961678 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 04:25:56 +0200 Subject: [PATCH 20/61] Closing ) --- 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 751be5d4c..007c77467 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -444,7 +444,7 @@ fn_details_teamspeak3(){ fn_details_mumble(){ echo -e "netstat -atunp | grep murmur" echo -e "" - port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }' + port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Voice\tIN&OUT\t${port}\tudp" From 8628c2572bff7e9179be03f80783c2ccdb499ef5 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:22:15 +0200 Subject: [PATCH 21/61] Removed port, will go to main script --- lgsm/functions/command_details.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 007c77467..f3ea415a6 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -444,7 +444,6 @@ fn_details_teamspeak3(){ fn_details_mumble(){ echo -e "netstat -atunp | grep murmur" echo -e "" - port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "> Voice\tIN&OUT\t${port}\tudp" From e1aa89d1a9fab4ec127f70e71253a647d7d68f42 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:24:01 +0200 Subject: [PATCH 22/61] added port info and servername --- Mumble/mumbleserver | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 5f30b6fa8..fe8dfbb45 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -43,6 +43,13 @@ servercfg="murmur.ini" servercfgdir="${filesdir}" servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${rootdir}/backups" +if [ -f "${servercfgfullpath}" ]; then + port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') + servername="Mumble Port ${port}" +else + port="UNKNOWN" + servername="Mumble" +fi # Logging logdays="7" From f1c11820bde128aac5ab3eeb5b39d3251d97c3aa Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:24:39 +0200 Subject: [PATCH 23/61] Contrib & version --- Mumble/mumbleserver | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index fe8dfbb45..b581812e2 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -2,6 +2,7 @@ # Mumble # Server Management Script # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log @@ -9,7 +10,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="270716" #### Variables #### From 7384278f38cbf3df2dab314db1357ac0f2391618 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:34:10 +0200 Subject: [PATCH 24/61] Added mumble status --- lgsm/functions/check_status.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index f82d75b58..4de0b306e 100644 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -18,6 +18,16 @@ if [ "${gamename}" == "Teamspeak 3" ]; then ts3error="${status}" status=0 fi + +elif [ "${gamename}" == "Mumble" ]; then + # 1: Server is listening + # 0: Server is not listening, considered closed + mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep 64738 | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') + if [ -z "${mumblepid}" ]; then + status=0 + else + status=1 + fi else status=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") fi From 39a31a04889ef3216c9b8c5d3e9f6f21b9ddb570 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:38:01 +0200 Subject: [PATCH 25/61] Mumble start parameters --- lgsm/functions/command_start.sh | 35 ++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 288c79e73..a95f070de 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -53,6 +53,39 @@ fn_start_teamspeak3(){ fi } +fn_start_mumble(){ + if [ ! -e "${servercfgfullpath}" ]; then + fn_print_warn_nl "${servercfgfullpath} is missing" + fn_script_log_warn "${servercfgfullpath} is missing" + sleep 2 + fi + sleep 1 + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_info_nl "${servername} is already running" + fn_script_log_error "${servername} is already running" + core_exit.sh + fi + + mv "${scriptlog}" "${scriptlogdate}" + # Create lock file + date > "${rootdir}/${lockselfname}" + cd "${executabledir}" + ./${executable} ${parms} > /dev/null 2>&1 + fi + sleep 1 + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_fail_nl "Unable to start ${servername}" + fn_script_log_fatal "Unable to start ${servername}" + echo -e " Check log files: ${rootdir}/log" + core_exit.sh + else + fn_print_ok_nl "${servername}" + fn_script_log_pass "Started ${servername}" + fi +} + fn_start_tmux(){ fn_parms @@ -182,4 +215,4 @@ if [ "${gamename}" == "Teamspeak 3" ]; then else fn_start_tmux fi -core_exit.sh \ No newline at end of file +core_exit.sh From 1e53947f97ab35155d254dc2cccfc27c12d8a06a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:38:57 +0200 Subject: [PATCH 26/61] fn_start_mumble --- lgsm/functions/command_start.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index a95f070de..a749b93d3 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -212,6 +212,8 @@ fi if [ "${gamename}" == "Teamspeak 3" ]; then fn_start_teamspeak3 +elif [ "${gamename}" == "Mumble" ]; then + fn_start_mumble else fn_start_tmux fi From 3b83a87044e209662c9d7e5ebe46f7acc686cf16 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:46:16 +0200 Subject: [PATCH 27/61] Added mumble stop --- lgsm/functions/command_stop.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index f1c333dee..e24ee93cb 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -212,6 +212,22 @@ fn_stop_teamspeak3(){ fi } +fn_stop_mumble(){ + fn_print_dots "Stopping ${servername}" + check_status.sh + kill ${mumblepid} + sleep 1 + if [ "${status}" == "0" ]; then + # Remove lock file + rm -f "${rootdir}/${lockselfname}" + fn_print_ok_nl "${servername}" + fn_script_log_pass "Stopped ${servername}" + else + fn_print_fail_nl "Unable to stop ${servername}" + fn_script_log_fail "Unable to stop ${servername}" + fi +} + fn_stop_tmux(){ fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${servername}" @@ -239,16 +255,21 @@ fn_stop_tmux(){ # checks if the server is already stopped before trying to stop. fn_stop_pre_check(){ + check_status.sh if [ "${gamename}" == "Teamspeak 3" ]; then - check_status.sh if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" fn_script_log_error "${servername} is already stopped" 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 else - check_status.sh if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" fn_script_log_error "${servername} is already stopped" @@ -263,4 +284,4 @@ sleep 1 check.sh info_config.sh fn_stop_pre_check -core_exit.sh \ No newline at end of file +core_exit.sh From 5beef0efa192f09f676899ff196627e09f657114 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:50:52 +0200 Subject: [PATCH 28/61] fi & quotes --- lgsm/functions/command_start.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index a749b93d3..697b74f27 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -71,8 +71,7 @@ fn_start_mumble(){ # Create lock file date > "${rootdir}/${lockselfname}" cd "${executabledir}" - ./${executable} ${parms} > /dev/null 2>&1 - fi + ./"${executable}" "${parms}" > /dev/null 2>&1 sleep 1 check_status.sh if [ "${status}" == "0" ]; then From ed76bb9f9ee4979f5749723cdf5162f8c48a8bdd Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:52:38 +0200 Subject: [PATCH 29/61] fi --- lgsm/functions/command_stop.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index e24ee93cb..c2ae9acb0 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -269,6 +269,7 @@ fn_stop_pre_check(){ 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" From c52fc7f5c3a04f413822ef83a503721e68f072a7 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 05:57:26 +0200 Subject: [PATCH 30/61] fn_script_log_fail doesn't exist & mumblepid --- lgsm/functions/command_stop.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index c2ae9acb0..5839498b8 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -208,15 +208,16 @@ fn_stop_teamspeak3(){ fn_script_log_pass "Stopped ${servername}" else fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_fail "Unable to stop ${servername}" + fn_script_log_error "Unable to stop ${servername}" fi } fn_stop_mumble(){ fn_print_dots "Stopping ${servername}" - check_status.sh + mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep 64738 | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') kill ${mumblepid} sleep 1 + check_status.sh if [ "${status}" == "0" ]; then # Remove lock file rm -f "${rootdir}/${lockselfname}" @@ -224,7 +225,7 @@ fn_stop_mumble(){ fn_script_log_pass "Stopped ${servername}" else fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_fail "Unable to stop ${servername}" + fn_script_log_error "Unable to stop ${servername}" fi } From 929cae9fcd9194cbd65716f419781a268a7a58d0 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:01:15 +0200 Subject: [PATCH 31/61] Removed quotes preventing start --- lgsm/functions/command_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 697b74f27..197056af3 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -71,7 +71,7 @@ fn_start_mumble(){ # Create lock file date > "${rootdir}/${lockselfname}" cd "${executabledir}" - ./"${executable}" "${parms}" > /dev/null 2>&1 + ./${executable} ${parms} > /dev/null 2>&1 sleep 1 check_status.sh if [ "${status}" == "0" ]; then From 307e72a3a1a30143cbca15dde740edc91c499f75 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:04:36 +0200 Subject: [PATCH 32/61] added mumble monitoring --- lgsm/functions/command_monitor.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 44e8506e7..9bb7af510 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -54,6 +54,23 @@ fn_monitor_teamspeak3(){ fi } +fn_monitor_mumble(){ + if [ "${status}" != "0" ]; then + fn_print_ok "Checking session: " + fn_print_ok_eol_nl + fn_script_log_pass "Checking session: OK" + else + fn_print_error "Checking session: Not listening to port ${port}" + fn_print_fail_eol_nl + fn_script_log_error "Checking session: Not listening to port ${port}" + failurereason="Checking session: Not listening to port ${port}" + alert="restart" + alert.sh + fn_script_log_info "Monitor is starting ${servername}" + sleep 1 + command_restart.sh + fi +} fn_monitor_tmux(){ # checks that tmux session is running if [ "${status}" != "0" ]; then @@ -92,7 +109,9 @@ fn_monitor_check_update fn_monitor_msg_checking if [ "${gamename}" == "Teamspeak 3" ]; then fn_monitor_teamspeak3 +elif [ "${gamename}" == "Mumble" ]; then + fn_monitor_mumble else fn_monitor_tmux fi -core_exit.sh \ No newline at end of file +core_exit.sh From 2d1422e25533b86d1d0ae50ff421e53968b8717b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:28:24 +0200 Subject: [PATCH 33/61] info config mumble --- lgsm/functions/info_config.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 00c9b40b5..864c33abc 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -211,6 +211,25 @@ fn_info_config_teamspeak3(){ fi } +fn_info_config_mumble(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="64738" + queryport="${port}" + else + # check if the ip exists in the config file. Failing this will fall back to the default. + ipconfigcheck=${cat "${servercfgfullpath}" | grep "host=" | awk -F'=' '{ print $2}' + if [ -n "${ipconfigcheck}" ]; then + ip="${ipconfigcheck}" + fi + port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') + queryport="${port}" + + # Not Set + port=${port:-"64738"} + queryport=${queryport:-"64738"} + fi +} + fn_info_config_teeworlds(){ if [ ! -f "${servercfgfullpath}" ]; then servername="unnamed server" @@ -318,8 +337,11 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then # Starbound elif [ "${engine}" == "starbound" ]; then fn_info_config_starbound +#TeamSpeak elif [ "${gamename}" == "Teamspeak 3" ]; then fn_info_config_teamspeak3 +elif [ "${gamename}" == "Mumble" ]; then + fn_info_config_mumble # Teeworlds elif [ "${engine}" == "teeworlds" ]; then fn_info_config_teeworlds @@ -329,4 +351,4 @@ elif [ "${engine}" == "terraria" ]; then # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then fn_info_config_unreal -fi \ No newline at end of file +fi From 43fc590f1e1fc07686b827338d4e9490ed002df6 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:29:07 +0200 Subject: [PATCH 34/61] contrib --- lgsm/functions/info_config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 864c33abc..9328acba9 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM info_config.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Gets specific details from config files. From 62a308e72949cc667b148befc26f9e01d72d5354 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:32:06 +0200 Subject: [PATCH 35/61] dev null --- Mumble/mumbleserver | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index b581812e2..3f6dd7a29 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -45,9 +45,10 @@ servercfgdir="${filesdir}" servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${rootdir}/backups" if [ -f "${servercfgfullpath}" ]; then - port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') + port=$(cat "${servercfgfullpath}" > /dev/null 2>&1 | grep 'port=' | awk -F'=' '{ print $2 }') servername="Mumble Port ${port}" else + ip="" port="UNKNOWN" servername="Mumble" fi From 25c2928f5be728d3a0a04864708f71014ef9fdca Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:45:15 +0200 Subject: [PATCH 36/61] open and close () --- 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 9328acba9..9c94b402e 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -218,7 +218,7 @@ fn_info_config_mumble(){ queryport="${port}" else # check if the ip exists in the config file. Failing this will fall back to the default. - ipconfigcheck=${cat "${servercfgfullpath}" | grep "host=" | awk -F'=' '{ print $2}' + ipconfigcheck=$(cat "${servercfgfullpath}" | grep "host=" | awk -F'=' '{ print $2}') if [ -n "${ipconfigcheck}" ]; then ip="${ipconfigcheck}" fi From 259c0a6e74d7cc6892c21ab8371ced0f6a9dfe0e Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:47:12 +0200 Subject: [PATCH 37/61] Just a spacing --- lgsm/functions/command_details.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index f3ea415a6..9a37f72ca 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -446,8 +446,8 @@ fn_details_mumble(){ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Voice\tIN&OUT\t${port}\tudp" - echo -e "> ServerQuery\tIN&OUT\t${port}\ttcp" + echo -e "> Voice\tIN & OUT\t${port}\tudp" + echo -e "> ServerQuery\tIN & OUT\t${port}\ttcp" } | column -s $'\t' -t } From e92b6995e6a0aa42e1d3a381c24231ba6ff4e619 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:47:37 +0200 Subject: [PATCH 38/61] contrib --- lgsm/functions/command_details.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 9a37f72ca..13bade020 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_details.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Displays server infomation. From b9a2824c7e8dd45aa373a98eb3a7e07a618fd6ac Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:54:48 +0200 Subject: [PATCH 39/61] Removed residual variable --- Mumble/mumbleserver | 1 - 1 file changed, 1 deletion(-) diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 3f6dd7a29..9c2630840 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -48,7 +48,6 @@ if [ -f "${servercfgfullpath}" ]; then port=$(cat "${servercfgfullpath}" > /dev/null 2>&1 | grep 'port=' | awk -F'=' '{ print $2 }') servername="Mumble Port ${port}" else - ip="" port="UNKNOWN" servername="Mumble" fi From 936fdfe3f2571bebd21a853f283f30ee4f85604e Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:55:45 +0200 Subject: [PATCH 40/61] Contrib --- lgsm/functions/command_install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index 79fede4a0..a7bdd4d1f 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_install.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Overall function for the installer. From 9949d78d13cc207d40f61d1b9e380384c0066c27 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:56:02 +0200 Subject: [PATCH 41/61] Contrib --- lgsm/functions/check_status.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 4de0b306e..7f6944e1e 100644 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM check_status.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Checks the proccess status of the server. Either online or offline. From fcf2ac2f6a1a52f82f83337e4730aca0ca95d523 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:56:28 +0200 Subject: [PATCH 42/61] Contrib --- lgsm/functions/command_monitor.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 9bb7af510..5496d7e1d 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_monitor.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Monitors server by checking for running proccesses # then passes to monitor_gsquery.sh. From 45076f9b30981090675280f0adc4c8d94618ac57 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:56:39 +0200 Subject: [PATCH 43/61] Contrib --- lgsm/functions/command_start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 197056af3..e5e848bca 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_start.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Starts the server. From 5677b48cd668d8c479ddb35333670da0d030bda7 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:57:19 +0200 Subject: [PATCH 44/61] Contrib --- lgsm/functions/command_stop.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 5839498b8..1ab955b9f 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM command_stop.sh function # Author: Daniel Gibbs +# Contributors: UltimateByte # Website: https://gameservermanagers.com # Description: Stops the server. From 85b499d5dee6c0837d617357395ebe2e4454f28a Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 06:57:36 +0200 Subject: [PATCH 45/61] Contrib --- lgsm/functions/core_dl.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 2a3c196a5..b8764ddf4 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -1,6 +1,7 @@ #!/bin/bash # LGSM core_dl.sh function # Author: Daniel Gibbs +# Contributor: UltimateByte # Website: https://gameservermanagers.com # Description: Deals with all downloads for LGSM. From c3b8f74a414f255cd275ea00485abdab9ceecca8 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Wed, 27 Jul 2016 16:54:04 +0200 Subject: [PATCH 46/61] No command_ts3_server_pass for mumble ! --- lgsm/functions/core_getopt.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index d7939ead7..d3cee3b1f 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -150,8 +150,6 @@ case "${getopt}" in command_details.sh;; b|backup) command_backup.sh;; - pw|change-password) - command_ts3_server_pass.sh;; dev|dev-debug) command_dev_debug.sh;; i|install) @@ -177,7 +175,6 @@ case "${getopt}" in 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}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." } | column -s $'\t' -t From 9b296971294695ad09acbecc703428ff32f0360e Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 28 Jul 2016 00:50:14 +0200 Subject: [PATCH 47/61] test tmux mumble --- lgsm/functions/command_start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index e5e848bca..17cc71909 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -212,8 +212,8 @@ fi if [ "${gamename}" == "Teamspeak 3" ]; then fn_start_teamspeak3 -elif [ "${gamename}" == "Mumble" ]; then - fn_start_mumble +#elif [ "${gamename}" == "Mumble" ]; then +# fn_start_mumble else fn_start_tmux fi From 6d0d1bff4c9e92b60ca66565c509de8218bdb0ae Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 28 Jul 2016 00:53:03 +0200 Subject: [PATCH 48/61] stop mumble tmux test --- lgsm/functions/command_stop.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 1ab955b9f..3a826ff35 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -215,6 +215,7 @@ fn_stop_teamspeak3(){ fn_stop_mumble(){ fn_print_dots "Stopping ${servername}" + fn_stop_tmux mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep 64738 | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') kill ${mumblepid} sleep 1 From 1d7b6187060b2545de3aee61db7152e7ba876c8b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 28 Jul 2016 00:58:25 +0200 Subject: [PATCH 49/61] tmux stop better location --- lgsm/functions/command_stop.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 3a826ff35..ccb350c12 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -215,7 +215,6 @@ fn_stop_teamspeak3(){ fn_stop_mumble(){ fn_print_dots "Stopping ${servername}" - fn_stop_tmux mumblepid=$(netstat -nap 2>/dev/null | grep udp | grep 64738 | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }') kill ${mumblepid} sleep 1 @@ -223,7 +222,7 @@ fn_stop_mumble(){ if [ "${status}" == "0" ]; then # Remove lock file rm -f "${rootdir}/${lockselfname}" - fn_print_ok_nl "${servername}" + fn_stop_tmux fn_script_log_pass "Stopped ${servername}" else fn_print_fail_nl "Unable to stop ${servername}" From 987327953ed1c945adf81d2cf6f7a306f1eda1dc Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 28 Jul 2016 00:58:55 +0200 Subject: [PATCH 50/61] -dev null --- Mumble/mumbleserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 9c2630840..b581812e2 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -45,7 +45,7 @@ servercfgdir="${filesdir}" servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${rootdir}/backups" if [ -f "${servercfgfullpath}" ]; then - port=$(cat "${servercfgfullpath}" > /dev/null 2>&1 | grep 'port=' | awk -F'=' '{ print $2 }') + port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') servername="Mumble Port ${port}" else port="UNKNOWN" From 3967e4e8b475d219e2be8c3c9bd1d060e209a364 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 28 Jul 2016 01:01:02 +0200 Subject: [PATCH 51/61] Mumble back to tmux, cleaning --- lgsm/functions/command_start.sh | 34 --------------------------------- 1 file changed, 34 deletions(-) diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 17cc71909..c39456268 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -54,38 +54,6 @@ fn_start_teamspeak3(){ fi } -fn_start_mumble(){ - if [ ! -e "${servercfgfullpath}" ]; then - fn_print_warn_nl "${servercfgfullpath} is missing" - fn_script_log_warn "${servercfgfullpath} is missing" - sleep 2 - fi - sleep 1 - check_status.sh - if [ "${status}" != "0" ]; then - fn_print_info_nl "${servername} is already running" - fn_script_log_error "${servername} is already running" - core_exit.sh - fi - - mv "${scriptlog}" "${scriptlogdate}" - # Create lock file - date > "${rootdir}/${lockselfname}" - cd "${executabledir}" - ./${executable} ${parms} > /dev/null 2>&1 - sleep 1 - check_status.sh - if [ "${status}" == "0" ]; then - fn_print_fail_nl "Unable to start ${servername}" - fn_script_log_fatal "Unable to start ${servername}" - echo -e " Check log files: ${rootdir}/log" - core_exit.sh - else - fn_print_ok_nl "${servername}" - fn_script_log_pass "Started ${servername}" - fi -} - fn_start_tmux(){ fn_parms @@ -212,8 +180,6 @@ fi if [ "${gamename}" == "Teamspeak 3" ]; then fn_start_teamspeak3 -#elif [ "${gamename}" == "Mumble" ]; then -# fn_start_mumble else fn_start_tmux fi From 2127a7eaa4e59f22aa21bc2b2258e8942edbfa64 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 28 Jul 2016 22:08:36 +0100 Subject: [PATCH 52/61] Code shuffle and update Shuffled code to match update_ts3.sh also updated messages to reflect recent updates to update_ts3.sh --- lgsm/functions/update_mumble.sh | 255 +++++++++++++++----------------- 1 file changed, 120 insertions(+), 135 deletions(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 46cc8ab79..612746221 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -9,162 +9,147 @@ local commandname="UPDATE" local commandaction="Update" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -fn_update_mumble_arch(){ -# Mumble is x86 only for now -mumblearch="x86" -} - -fn_update_mumble_availablebuild(){ -# Gets latest build info. -fn_print_info_nl "Checking latest build from github.com" -fn_script_log "Checking latest build from github.com" -availablebuild=$(curl -s https://api.github.com/repos/mumble-voip/mumble/releases/latest | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') -sleep 1 - -# Checks if availablebuild variable has been set -if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking latest build from github.com" - sleep 1 - fn_print_fail "Checking latest build from github.com: Not returning version info" - fn_script_log_fatal "Checking latest build from github.com: Not returning version info" - core_exit.sh -else - fn_print_ok_nl "Checked latest build from github.com" - fn_script_log_pass "Checked latest build from github.com" - sleep 1 -fi +fn_update_mumble_dl(){ + fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${lgsmdir}/tmp" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2" + fn_dl_extract "${lgsmdir}/tmp" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${lgsmdir}/tmp" + echo -e "copying to ${filesdir}...\c" + fn_script_log "Copying to ${filesdir}" + cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${availablebuild}/"* "${filesdir}" + rm -R "${lgsmdir}/tmp" + local exitcode=$? + if [ ${exitcode} -eq 0 ]; then + fn_print_ok_eol_nl + else + fn_print_fail_eol_nl + fi } fn_update_mumble_currentbuild(){ -# Gets current build info -fn_print_info "Checking installed server build" -sleep 1 -# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. -if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then - fn_print_info_nl "No current log found, can't retrieve current server build" - fn_script_log_info "No current log found, can't retrieve current server build" - sleep 1 - fn_print_info_nl "Forcing server restart" - fn_script_log_info "Forcing server restart" - sleep 1 - check_status.sh - if [ "${status}" != "0" ]; then + # Gets current build info + # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. + if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then + fn_print_error "Checking for update: GitHub" + sleep 1 + fn_print_error_nl "Checking for update: GitHub: No logs with server version found" + fn_script_log_error "Checking for update: GitHub: No logs with server version found" + sleep 1 + fn_print_info_nl "Checking for update: GitHub: Forcing server restart" + fn_script_log_info "Checking for update: GitHub: Forcing server restart" + sleep 1 exitbypass=1 command_stop.sh + exitbypass=1 + command_start.sh + sleep 1 + # Check again and exit on failure. + if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then + fn_print_fail_nl "Checking for update: GitHub: Still No logs with server version found" + fn_script_log_fatal "Checking for update: GitHub: Still No logs with server version found" + core_exit.sh + fi fi - exitbypass=1 - command_start.sh - exitbypass=1 - command_stopt.sh - sleep 1 - # Check again and exit on failure. - if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then - fn_print_fail_nl "Still no logs found, cannot retrieve server version" - fn_script_log_fatal "Still no logs found, cannot retrieve server version" - core_exit.sh - else - fn_print_ok_nl "Logs found" - fn_script_log "Logs found" - sleep 1 - fi -fi - -# Get current build from logs -currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') -if [ -z "${currentbuild}" ]; then - fn_print_info_nl "Can't find current build version in logs" - fn_script_log_error "Can't find current build version in logs" - sleep 1 - fn_print_info_nl "Forcing server restart" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh + # Get current build from logs currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') if [ -z "${currentbuild}" ]; then - fn_print_fail_nl "Sorry, current build version still not found" - fn_script_log_fatal "Sorry, current build version still not found" + fn_print_error_nl "Checking for update: GitHub: Current build version not found" + fn_script_log_error "Checking for update: GitHub: Current build version not found" + sleep 1 + fn_print_info_nl "Checking for update: GitHub: Forcing server restart" + fn_script_log_info "Checking for update: GitHub: Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | egrep 'Murmur ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | awk '{print $4}') + if [ -z "${currentbuild}" ]; then + fn_print_fail_nl "Checking for update: GitHub: Current build version still not found" + fn_script_log_fatal "Checking for update: GitHub: Current build version still not found" + core_exit.sh + fi + fi +} + +fn_update_mumble_arch(){ + # Mumble is x86 only for now + mumblearch="x86" +} + +fn_update_mumble_availablebuild(){ + # Gets latest build info. + availablebuild=$(curl -s https://api.github.com/repos/mumble-voip/mumble/releases/latest | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') + sleep 1 + + # Checks if availablebuild variable has been set + if [ -z "${availablebuild}" ]; then + fn_print_fail "Checking for update: GitHub" + sleep 1 + fn_print_fail "Checking for update: GitHub: Not returning version info" + fn_script_log_fatal "Failure! Checking for update: GitHub: Not returning version info" core_exit.sh + else + fn_print_ok_nl "Checking for update: GitHub" + fn_script_log_pass "Checking for update: GitHub" + sleep 1 fi -fi } fn_update_mumble_compare(){ -# Removes dots so if can compare version numbers -currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') -availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') + # Removes dots so if can compare version numbers + currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') + availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') -if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then - echo -e "\n" - echo -e "Update available:" - sleep 1 - echo -e " Current build: ${red}${currentbuild} ${mumblearch}${default}" - echo -e " Available build: ${green}${availablebuild} ${mumblearch}${default}" - echo -e "" - sleep 1 - echo "" - echo -en "Applying update.\r" - sleep 1 - echo -en "Applying update..\r" - sleep 1 - echo -en "Applying update...\r" - sleep 1 - echo -en "\n" - fn_script_log "Update available" - fn_script_log "Current build: ${currentbuild}" - fn_script_log "Available build: ${availablebuild}" - fn_script_log "${currentbuild} > ${availablebuild}" + if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then + echo -e "\n" + echo -e "Update available:" + sleep 1 + echo -e " Current build: ${red}${currentbuild} ${mumblearch}${default}" + echo -e " Available build: ${green}${availablebuild} ${mumblearch}${default}" + echo -e "" + sleep 1 + echo "" + echo -en "Applying update.\r" + sleep 1 + echo -en "Applying update..\r" + sleep 1 + echo -en "Applying update...\r" + sleep 1 + echo -en "\n" + fn_script_log "Update available" + fn_script_log "Current build: ${currentbuild}" + fn_script_log "Available build: ${availablebuild}" + fn_script_log "${currentbuild} > ${availablebuild}" - unset updateonstart + unset updateonstart - check_status.sh - if [ "${status}" == "0" ]; then - fn_update_mumble_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh + check_status.sh + if [ "${status}" == "0" ]; then + fn_update_mumble_dl + exitbypass=1 + command_start.sh + exitbypass=1 + command_stop.sh + else + exitbypass=1 + command_stop.sh + fn_update_mumble_dl + exitbypass=1 + command_start.sh + fi + alert="update" + alert.sh else - exitbypass=1 - command_stop.sh - fn_update_mumble_dl - exitbypass=1 - command_start.sh + echo -e "\n" + echo -e "No update available:" + echo -e " Current version: ${green}${currentbuild}${default}" + echo -e " Available version: ${green}${availablebuild}${default}" + echo -e "" + fn_print_ok_nl "No update available" + fn_script_log_info "Current build: ${currentbuild}" + fn_script_log_info "Available build: ${availablebuild}" fi - alert="update" - alert.sh -else - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: ${green}${currentbuild}${default}" - echo -e " Available version: ${green}${availablebuild}${default}" - echo -e "" - fn_print_ok_nl "No update available" - fn_script_log_info "Current build: ${currentbuild}" - fn_script_log_info "Available build: ${availablebuild}" -fi } -fn_update_mumble_dl(){ -mumblebuildname="murmur-static_${mumblearch}-${availablebuild}" -if [ ! -d "${lgsmdir}/tmp" ]; then - mkdir "${lgsmdir}/tmp" -fi -fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" -fn_dl_extract "${lgsmdir}/tmp" "${mumblebuildname}.tar.bz2" "${lgsmdir}/tmp" -echo -e "copying to ${filesdir}...\c" -fn_script_log "Copying to ${filesdir}" -cp -R "${lgsmdir}/tmp/${mumblebuildname}/"* "${filesdir}" -rm -R "${lgsmdir}/tmp" -local exitcode=$? -if [ ${exitcode} -eq 0 ]; then - fn_print_ok_eol_nl -else - fn_print_fail_eol_nl -fi -} fn_update_mumble_arch if [ "${installer}" == "1" ]; then From 8a47bbfc23bfe71c0b256c8f101c4f8267fcf19a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 28 Jul 2016 22:09:04 +0100 Subject: [PATCH 53/61] minor messages tweaks --- lgsm/functions/update_ts3.sh | 75 ++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 3745eed49..e4ee2ddc6 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -47,6 +47,7 @@ fn_update_ts3_currentbuild(){ fi fi + # Get current build from logs currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') if [ -z "${currentbuild}" ]; then fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found" @@ -76,52 +77,52 @@ elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then ts3arch="x86" else echo "" - fn_print_failure "unknown or unsupported architecture: ${arch}" - fn_script_log_fatal "unknown or unsupported architecture: ${arch}" + fn_print_failure "Unknown or unsupported architecture: ${arch}" + fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" core_exit.sh fi } fn_update_ts3_availablebuild(){ -# Gets availablebuild info. + # Gets latest build info. -# Creates tmp dir if missing -if [ ! -d "${lgsmdir}/tmp" ]; then - mkdir -p "${lgsmdir}/tmp" -fi + # Creates tmp dir if missing + if [ ! -d "${lgsmdir}/tmp" ]; then + mkdir -p "${lgsmdir}/tmp" + fi -# Grabs all version numbers but not in correct order. -wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" + # Grabs all version numbers but not in correct order. + wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" -# Sort version numbers -cat "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" | sort -r --version-sort -o "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" + # Sort version numbers + cat "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" | sort -r --version-sort -o "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" -# Finds directory with most recent server version. -while read ts3_version_number; do - wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" - if [ $? -eq 0 ]; then - availablebuild="${ts3_version_number}" - # Break while-loop, if the latest release could be found. - break - fi -done < "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" + # Finds directory with most recent server version. + while read ts3_version_number; do + wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" + if [ $? -eq 0 ]; then + availablebuild="${ts3_version_number}" + # Break while-loop, if the latest release could be found. + break + fi + done < "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" -# Tidy up -rm -f "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" -rm -f "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" + # Tidy up + rm -f "${lgsmdir}/tmp/.ts3_version_numbers_unsorted.tmp" + rm -f "${lgsmdir}/tmp/.ts3_version_numbers_sorted.tmp" -# Checks availablebuild info is available -if [ -z "${availablebuild}" ]; then - fn_print_fail "Checking for update: teamspeak.com" - sleep 1 - fn_print_fail "Checking for update: teamspeak.com: Not returning version info" - fn_script_log_fatal "Failure! Checking for update: teamspeak.com: Not returning version info" - core_exit.sh -else - fn_print_ok_nl "Checking for update: teamspeak.com" - fn_script_log_pass "Checking for update: teamspeak.com" - sleep 1 -fi + # Checks availablebuild info is available + if [ -z "${availablebuild}" ]; then + fn_print_fail "Checking for update: teamspeak.com" + sleep 1 + fn_print_fail "Checking for update: teamspeak.com: Not returning version info" + fn_script_log_fatal "Failure! Checking for update: teamspeak.com: Not returning version info" + core_exit.sh + else + fn_print_ok_nl "Checking for update: teamspeak.com" + fn_script_log_pass "Checking for update: teamspeak.com" + sleep 1 + fi } fn_update_ts3_compare(){ @@ -133,8 +134,8 @@ fn_update_ts3_compare(){ echo -e "\n" echo -e "Update available:" sleep 1 - echo -e " Current build: ${red}${currentbuild} ${architecture}${default}" - echo -e " Available build: ${green}${availablebuild} ${architecture}${default}" + echo -e " Current build: ${red}${currentbuild} ${ts3arch}${default}" + echo -e " Available build: ${green}${availablebuild} ${ts3arch}${default}" echo -e "" sleep 1 echo "" From 4405c42122356c4407f229d2bc6b50d8b9993136 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 29 Jul 2016 10:08:49 +0100 Subject: [PATCH 54/61] removed rm tmp dir --- lgsm/functions/update_mumble.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 612746221..ba4b6f3ce 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -15,7 +15,6 @@ fn_update_mumble_dl(){ echo -e "copying to ${filesdir}...\c" fn_script_log "Copying to ${filesdir}" cp -R "${lgsmdir}/tmp/murmur-static_${mumblearch}-${availablebuild}/"* "${filesdir}" - rm -R "${lgsmdir}/tmp" local exitcode=$? if [ ${exitcode} -eq 0 ]; then fn_print_ok_eol_nl From 0bfc6e936682ace47eca447bdb71941631a02f9f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 29 Jul 2016 22:48:42 +0100 Subject: [PATCH 55/61] added updateonstart Fixed gamelogdir and shuffled stuff around to match other scripts. --- Mumble/mumbleserver | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index b581812e2..d05305a0d 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -10,7 +10,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="270716" +version="290716" #### Variables #### @@ -26,6 +26,23 @@ email="email@example.com" pushbulletalert="off" pushbullettoken="accesstoken" +# Start Variables +updateonstart="off" + +fn_parms(){ +parms="-fg -ini ${servercfgfullpath}" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + + # Server Details gamename="Mumble" servicename="mumble-server" @@ -44,6 +61,7 @@ servercfg="murmur.ini" servercfgdir="${filesdir}" servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${rootdir}/backups" + if [ -f "${servercfgfullpath}" ]; then port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') servername="Mumble Port ${port}" @@ -54,7 +72,7 @@ fi # Logging logdays="7" -logdir="${rootdir}/log" +gamelogdir="${rootdir}/log" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" consolelogging="on" @@ -66,17 +84,6 @@ 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" -fn_parms(){ -parms="-fg -ini ${servercfgfullpath}" -} - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - ##### Script ##### # Do not edit From 08526ed204c8c813fc69e88ff0a56f595f59209d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 29 Jul 2016 22:49:19 +0100 Subject: [PATCH 56/61] removed comment --- ARKSurvivalEvolved/arkserver | 2 +- Left4Dead2/l4d2server | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index d236fd9d4..e95f539c6 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -40,7 +40,7 @@ ip="0.0.0.0" updateonstart="off" fn_parms(){ - parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}" +parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}" } #### Advanced Variables #### diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index d7801dc2e..9d48326d1 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -25,9 +25,6 @@ email="email@example.com" pushbulletalert="off" pushbullettoken="accesstoken" -# Pushover -#Push alot - # Steam login steamuser="anonymous" steampass="" From b31ae3ba6c5d447f613e9ff7263564d0a7c72488 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 29 Jul 2016 23:02:14 +0100 Subject: [PATCH 57/61] INBOUND --- lgsm/functions/command_details.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 44000b3d1..df3e49e6a 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -447,8 +447,8 @@ fn_details_mumble(){ echo -e "" { echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Voice\tIN & OUT\t${port}\tudp" - echo -e "> ServerQuery\tIN & OUT\t${port}\ttcp" + echo -e "> Voice\tINBOUND\t${port}\tudp" + echo -e "> ServerQuery\tINBOUND\t${port}\ttcp" } | column -s $'\t' -t } From 1f11921445c4f1bb7758e034697fc936493ea925 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 29 Jul 2016 23:11:37 +0100 Subject: [PATCH 58/61] moved port and server name to info_config.sh --- Mumble/mumbleserver | 8 -------- lgsm/functions/info_config.sh | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index d05305a0d..628a07ad4 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -62,14 +62,6 @@ servercfgdir="${filesdir}" servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${rootdir}/backups" -if [ -f "${servercfgfullpath}" ]; then - port=$(cat "${servercfgfullpath}" | grep 'port=' | awk -F'=' '{ print $2 }') - servername="Mumble Port ${port}" -else - port="UNKNOWN" - servername="Mumble" -fi - # Logging logdays="7" gamelogdir="${rootdir}/log" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 139dadc13..1f754d62d 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -225,6 +225,7 @@ fn_info_config_mumble(){ if [ ! -f "${servercfgfullpath}" ]; then port="64738" queryport="${port}" + servername="Mumble" else # check if the ip exists in the config file. Failing this will fall back to the default. ipconfigcheck=$(cat "${servercfgfullpath}" | grep "host=" | awk -F'=' '{ print $2}') @@ -237,6 +238,8 @@ fn_info_config_mumble(){ # Not Set port=${port:-"64738"} queryport=${queryport:-"64738"} + + servername="Mumble Port ${port}" fi } From 53e88342be6a62886a2f63f66b12ebd3103066ab Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 29 Jul 2016 23:25:34 +0100 Subject: [PATCH 59/61] moved emailnotification to legacy code fixes --- lgsm/functions/alert.sh | 4 ++-- lgsm/functions/core_functions.sh | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 5aaf3103e..9cef86e95 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -41,9 +41,9 @@ elif [ "${alert}" == "test" ]; then fn_alert_test fi -if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then +if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then alert_email.sh -elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then +elif [ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_warn_nl "Email alerts not enabled" fn_script_log_warn "Email alerts not enabled" elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index a5d3369e9..da170b8d5 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -5,9 +5,13 @@ # Description: Defines all functions to allow download and execution of functions using fn_fetch_function. # This function is called first before any other function. Without this file other functions will not load. -# Fix for TeamSpeak 3 scripts using gamename="Teamspeak 3" -if [ "${gamename}" == "Teamspeak 3" ]; then - gamename="TeamSpeak 3" +# Fixes legacy code +if [ "${gamename}" == "Teamspeak 3" ]; then + gamename="TeamSpeak 3" +fi + +if [ "${emailnotification}" == "on" ]; then + emailalert="on" fi # Code/functions for legacy servers From 7dc5f64915e3a9be699f1d1b54f46654c911a293 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 29 Jul 2016 23:26:31 +0100 Subject: [PATCH 60/61] word --- lgsm/functions/core_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index da170b8d5..5a9dce2c9 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -5,7 +5,7 @@ # Description: Defines all functions to allow download and execution of functions using fn_fetch_function. # This function is called first before any other function. Without this file other functions will not load. -# Fixes legacy code +# Fixes for legacy code if [ "${gamename}" == "Teamspeak 3" ]; then gamename="TeamSpeak 3" fi From 8881508e9a7b78ac10650f21e7c9cf9dd2b9f238 Mon Sep 17 00:00:00 2001 From: Marvin Lehmann Date: Sat, 30 Jul 2016 14:48:48 +0200 Subject: [PATCH 61/61] Added directory check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fixes error message: find: ‘/home/server/serverfiles’: No such file or directory --- lgsm/functions/check_permissions.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index c95a76479..c41f8d67f 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -9,21 +9,23 @@ local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_check_ownership(){ - if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then - fn_print_fail_nl "Permissions issues found" - fn_script_log_fatal "Permissions issues found" - fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:" - fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" - { - echo -e "User\tGroup\tFile\n" - find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" - } | column -s $'\t' -t | tee -a "${scriptlog}" - core_exit.sh + if [ -d "${filesdir}" ]; then + if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then + fn_print_fail_nl "Permissions issues found" + fn_script_log_fatal "Permissions issues found" + fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:" + fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" + { + echo -e "User\tGroup\tFile\n" + find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + } | column -s $'\t' -t | tee -a "${scriptlog}" + core_exit.sh + fi fi } fn_check_permissions(){ - if [ -n "${functionsdir}" ]; then + if [ -d "${functionsdir}" ]; then if [ $(find "${functionsdir}" -type f -not -executable|wc -l) -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" @@ -56,4 +58,4 @@ fn_check_permissions(){ } fn_check_ownership -fn_check_permissions \ No newline at end of file +fn_check_permissions