From 9168387277140d4af1ffa70a585f39d82e2e2beb Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 7 Aug 2016 21:08:38 +0100 Subject: [PATCH 1/8] os has become distroname also added distroversion to identify the distro version number --- lgsm/functions/alert_email.sh | 2 +- lgsm/functions/command_debug.sh | 2 +- lgsm/functions/command_details.sh | 2 +- lgsm/functions/info_distro.sh | 10 ++++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index a89ef4967..52529db6f 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -32,7 +32,7 @@ fn_details_os(){ echo -e "" echo -e "Distro Details" echo -e "=================================" - echo -e "Distro: ${os}" + echo -e "Distro: ${distroname}" echo -e "Arch: ${arch}" echo -e "Kernel: ${kernel}" echo -e "Hostname: $HOSTNAME" diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 260cd91fb..79dc4a4d5 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -28,7 +28,7 @@ echo "" echo "${gamename} Debug" echo "=================================" echo "" -echo -e "Distro: ${os}" +echo -e "Distro: ${distroname}" echo -e "Arch: ${arch}" echo -e "Kernel: ${kernel}" echo -e "Hostname: $HOSTNAME" diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index df3e49e6a..cbac77f7a 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -27,7 +27,7 @@ fn_details_os(){ echo -e "${lightyellow}Distro Details${default}" printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = { - echo -e "${blue}Distro:\t${default}${os}" + echo -e "${blue}Distro:\t${default}${distroname}" echo -e "${blue}Arch:\t${default}${arch}" echo -e "${blue}Kernel:\t${default}${kernel}" echo -e "${blue}Hostname:\t${default}$HOSTNAME" diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 02a2c0488..8e7bea670 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -14,15 +14,17 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" arch=$(uname -m) kernel=$(uname -r) if [ -n "$(command -v lsb_release)" ]; then - os=$(lsb_release -s -d) + distroname=$(lsb_release -s -d) elif [ -f "/etc/debian_version" ]; then - os="Debian $(cat /etc/debian_version)" + distroname="Debian $(cat /etc/debian_version)" elif [ -f "/etc/redhat-release" ]; then - os=$(cat /etc/redhat-release) + distroname=$(cat /etc/redhat-release) else - os="$(uname -s) $(uname -r)" + distroname="$(uname -s) $(uname -r)" fi +distroversion=$(grep VERSION_ID /etc/os-release |tr -cd '[:digit:]') + ## Glibc version # e.g: 1.17 glibcversion="$(ldd --version | sed -n '1s/.* //p')" From c10846ba4a4e45928dfa995b88a95cf262067888 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 7 Aug 2016 21:08:53 +0100 Subject: [PATCH 2/8] Updated java requirements --- lgsm/functions/check_deps.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 6b43262ef..a5f5ef88f 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -63,7 +63,7 @@ fn_found_missing_deps(){ if [ "${#array_deps_missing[@]}" != "0" ]; then fn_print_dots "Checking dependencies" sleep 0.5 - fn_print_error "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" + fn_print_error_nl "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" fn_script_log_error "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}" sleep 1 sudo -v > /dev/null 2>&1 @@ -86,7 +86,7 @@ fn_found_missing_deps(){ fi if [ $? != 0 ]; then fn_print_failure_nl "Unable to install dependencies" - fn_script_log_fail "Unable to install dependencies" + fn_script_log_fatal "Unable to install dependencies" else fn_print_complete_nl "Install dependencies completed" fn_script_log_pass "Install dependencies completed" @@ -165,7 +165,7 @@ if [ -n "$(command -v dpkg-query)" ]; then array_deps_required+=( libcurl4-gnutls-dev:i386 ) # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then - array_deps_required+=( openjdk-7-jre ) + array_deps_required+=( default-jdk ) # Unreal engine elif [ "${executable}" == "./ucc-bin" ]; then #UT2K4 @@ -212,7 +212,7 @@ elif [ -n "$(command -v yum)" ]; then array_deps_required+=( libcurl.i686 ) # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then - array_deps_required+=( java-1.7.0-openjdk ) + array_deps_required+=( java-1.8.0-openjdk ) # Unreal engine elif [ "${executable}" == "./ucc-bin" ]; then #UT2K4 From 0c471b91f0bbc3e93953cdabac7760671af7d7bf Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 7 Aug 2016 21:16:24 +0100 Subject: [PATCH 3/8] Added os-release as an option for distroname --- lgsm/functions/info_distro.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 8e7bea670..85801a70d 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -15,6 +15,8 @@ arch=$(uname -m) kernel=$(uname -r) if [ -n "$(command -v lsb_release)" ]; then distroname=$(lsb_release -s -d) +elif [ -f "/etc/os-release" ]; then + distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="') elif [ -f "/etc/debian_version" ]; then distroname="Debian $(cat /etc/debian_version)" elif [ -f "/etc/redhat-release" ]; then @@ -23,7 +25,7 @@ else distroname="$(uname -s) $(uname -r)" fi -distroversion=$(grep VERSION_ID /etc/os-release |tr -cd '[:digit:]') +distroversion=$(grep VERSION_ID /etc/os-release | tr -cd '[:digit:]') ## Glibc version # e.g: 1.17 @@ -33,7 +35,7 @@ glibcversion="$(ldd --version | sed -n '1s/.* //p')" # e.g: tmux 1.6 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 +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) From ed0ddc35f4acb18edb20a5a84276e705a713bc04 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 7 Aug 2016 23:13:08 +0100 Subject: [PATCH 4/8] tmux will now be detected if compiled from source #736 --- lgsm/functions/check_deps.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index a5f5ef88f..77515afdd 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -9,7 +9,7 @@ local commandname="CHECK" fn_deps_detector(){ # Checks if dependency is missing if [ -n "$(command -v dpkg-query)" ]; then - dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null| grep -q -P '^install ok installed$' + dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null | grep -q -P '^install ok installed$' depstatus=$? elif [ -n "$(command -v yum)" ]; then yum -q list installed ${deptocheck} > /dev/null 2>&1 @@ -18,6 +18,11 @@ fn_deps_detector(){ if [ "${depstatus}" == "0" ]; then missingdep=0 if [ "${function_selfname}" == "command_install.sh" ]; then + if [ "${tmuxcheck}" != "1" ]; then + # Added for users compiling tmux from source to bypass rpm check + echo -e "${green}tmux${default}" + tmuxcheck=1 + fi echo -e "${green}${deptocheck}${default}" sleep 0.5 fi @@ -137,7 +142,11 @@ if [ -n "$(command -v dpkg-query)" ]; then # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then - array_deps_required+=( tmux ) + if [ "$(command -v tmux)" ]||[ "$(which tmux)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then + : # Added for users compiling tmux from source to bypass rpm check + else + array_deps_required+=( tmux ) + fi fi # All servers except ts3 & mumble require libstdc++6, lib32gcc1 @@ -184,11 +193,19 @@ elif [ -n "$(command -v yum)" ]; then array_deps_missing=() # LGSM requirements - array_deps_required=( curl util-linux python file ) + if [ "${distroversion}" == "6" ]; then + array_deps_required=( curl util-linux-ng python file ) + else + array_deps_required=( curl util-linux python file ) + fi # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then - array_deps_required+=( tmux ) + if [ "$(command -v tmux)" ]||[ "$(which tmux)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then + : # Added for users compiling tmux from source to bypass rpm check + else + array_deps_required+=( tmux ) + fi fi # All servers excelts ts3 & mumble require glibc.i686 libstdc++.i686 From 4bd108ad05568998367020a3a29a01b0b889cda1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 8 Aug 2016 00:12:06 +0100 Subject: [PATCH 5/8] added gzip as a required dependency #977 SteamCMD required gzip to extract itself. I would be suprised if there was a distro without this built in. However will add this just in case. --- lgsm/functions/check_deps.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 77515afdd..8d6c1f43e 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -138,7 +138,7 @@ if [ -n "$(command -v dpkg-query)" ]; then array_deps_missing=() # LGSM requirements - array_deps_required=( curl ca-certificates file bsdmainutils util-linux python ) + array_deps_required=( curl ca-certificates file bsdmainutils util-linux python gzip ) # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then @@ -194,9 +194,9 @@ elif [ -n "$(command -v yum)" ]; then # LGSM requirements if [ "${distroversion}" == "6" ]; then - array_deps_required=( curl util-linux-ng python file ) + array_deps_required=( curl util-linux-ng python file gzip ) else - array_deps_required=( curl util-linux python file ) + array_deps_required=( curl util-linux python file gzip ) fi # All servers except ts3 require tmux From 3db7a0ec35521cc3303dd667e60b0f785d33845b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 8 Aug 2016 17:03:09 +0100 Subject: [PATCH 6/8] bzip2 and gzip are now required by default --- lgsm/functions/check_deps.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 8d6c1f43e..f5073e80f 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -138,7 +138,7 @@ if [ -n "$(command -v dpkg-query)" ]; then array_deps_missing=() # LGSM requirements - array_deps_required=( curl ca-certificates file bsdmainutils util-linux python gzip ) + array_deps_required=( curl ca-certificates file bsdmainutils util-linux python bzip2 gzip ) # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then @@ -194,9 +194,9 @@ elif [ -n "$(command -v yum)" ]; then # LGSM requirements if [ "${distroversion}" == "6" ]; then - array_deps_required=( curl util-linux-ng python file gzip ) + array_deps_required=( curl util-linux-ng python file ) else - array_deps_required=( curl util-linux python file gzip ) + array_deps_required=( curl util-linux python file ) fi # All servers except ts3 require tmux From 0a48898e10886e66186ec771faa681af7898ae7d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 8 Aug 2016 17:54:37 +0100 Subject: [PATCH 7/8] added gzip and bzip 2 as a requirement for centos --- lgsm/functions/check_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index f5073e80f..d9f04f506 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -194,9 +194,9 @@ elif [ -n "$(command -v yum)" ]; then # LGSM requirements if [ "${distroversion}" == "6" ]; then - array_deps_required=( curl util-linux-ng python file ) + array_deps_required=( curl util-linux-ng python file gzip bzip2 ) else - array_deps_required=( curl util-linux python file ) + array_deps_required=( curl util-linux python file gzip bzip2 ) fi # All servers except ts3 require tmux From 1b99b320677f68ad1a9c3c28c4d59be572df3310 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 8 Aug 2016 22:55:06 +0100 Subject: [PATCH 8/8] bug in project zomboid --- lgsm/functions/info_glibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index cb1cb3c31..44ceeca9a 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -37,7 +37,7 @@ elif [ "${engine}" == "dontstarve" ]; then glibcfix="no" elif [ "${engine}" == "projectzomboid" ]; then glibcrequired="2.15" - glibcfix="yesno" + glibcfix="no" elif [ "${engine}" == "realvirtuality" ]; then glibcrequired="2.13" glibcfix="yes"