From 389964f739d70504767fb81c0769a51a16362806 Mon Sep 17 00:00:00 2001 From: Bryan Jeter Date: Tue, 2 Mar 2021 20:57:48 -0600 Subject: [PATCH] Force $lastbackup to use latest date. Use ls -1tr in place of find * produce a simple list, * one item per line, * sorted by date reverse. --- lgsm/functions/info_distro.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 697ee007d..f14447bce 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -8,6 +8,10 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +### Game Server pid +if [ "${status}" == "1" ]; then + gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}') +fi ### Distro information ## Distro @@ -66,17 +70,17 @@ done glibcversion=$(ldd --version | sed -n '1s/.* //p') ## tmux version -tmuxv=$(tmux -V | sed "s/tmux //") -tmuxvdigit=$(echo "${tmuxv}" | tr -cd '[:digit:]') - -## Game Server pid -if [ "${status}" == "1" ]&&[ "${tmuxv}" != "1.8" ]; then - gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}') +# e.g: tmux 1.6 +if [ ! "$(command -V tmux 2>/dev/null)" ]; then + tmuxv="${red}NOT INSTALLED!${default}" +else + if [ "$(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) + fi fi -## Date -date="$(date)" - ## Uptime uptime=$(