From afe1853ab2571a4deaa47857783087ca4f0d07d2 Mon Sep 17 00:00:00 2001 From: Chaos Date: Mon, 20 Mar 2017 17:39:43 -0600 Subject: [PATCH 1/3] Resolves #1377 --- lgsm/functions/info_distro.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index d8d733d64..abc3fff59 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -37,12 +37,14 @@ glibcversion="$(ldd --version | sed -n '1s/.* //p')" ## tmux version # e.g: tmux 1.6 -if [ -z "$(command -v tmux)" ]; then +if [ -z "$(command -V tmux)" ]; then tmuxv="${red}NOT INSTALLED!${default}" -elif [ "$(tmux -V|sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" -lt "16" ]; then - tmuxv="$(tmux -V) (>= 1.6 required for console log)" else - tmuxv=$(tmux -V) + if [ "$(tmux -V|sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" -lt "16" ] 2>/dev/null; then + tmuxv="$(tmux -V) (>= 1.6 required for console log)" + else + tmuxv=$(tmux -V) + fi fi ## Uptime From 4b547ef89973114c0a9cd502f804ef8f3f66171b Mon Sep 17 00:00:00 2001 From: Chaos Date: Mon, 20 Mar 2017 17:56:00 -0600 Subject: [PATCH 2/3] Fixes the same issue in command_start --- 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 1f411af48..4bad75d7b 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -84,13 +84,13 @@ fn_start_tmux(){ tmux new-session -d -s "${servicename}" "${executable} ${parms}" 2> "${scriptlogdir}/.${servicename}-tmux-error.tmp" # tmux pipe-pane not supported in tmux versions < 1.6 - if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then + if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ] 2>/dev/null; then echo "Console logging disabled: Tmux => 1.6 required https://gameservermanagers.com/tmux-upgrade Currently installed: $(tmux -V)" > "${consolelog}" # Console logging disabled: Bug in tmux 1.8 breaks logging - elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then + elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ] 2>/dev/null; then echo "Console logging disabled: Bug in tmux 1.8 breaks logging https://gameservermanagers.com/tmux-upgrade Currently installed: $(tmux -V)" > "${consolelog}" From d0c6cbf1cce34e28cc9d7c0df31322166c5950d3 Mon Sep 17 00:00:00 2001 From: Chaos Date: Mon, 20 Mar 2017 17:56:59 -0600 Subject: [PATCH 3/3] Helpful comment as to why I'm doing this --- 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 4bad75d7b..b4928905d 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -84,7 +84,7 @@ fn_start_tmux(){ tmux new-session -d -s "${servicename}" "${executable} ${parms}" 2> "${scriptlogdir}/.${servicename}-tmux-error.tmp" # tmux pipe-pane not supported in tmux versions < 1.6 - if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ] 2>/dev/null; then + if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ] 2>/dev/null; then # Tmux compiled from source will not return a number, therefore bypass this check and trash the error echo "Console logging disabled: Tmux => 1.6 required https://gameservermanagers.com/tmux-upgrade Currently installed: $(tmux -V)" > "${consolelog}"