From 43cbe0197081bbc7b0e0d8b44ca4c6475d14a7cb Mon Sep 17 00:00:00 2001 From: Phil Date: Sun, 17 Jan 2016 20:59:15 +0100 Subject: [PATCH 01/22] fix fix for issue #629 --- functions/fix_ins.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/functions/fix_ins.sh b/functions/fix_ins.sh index 0e9c77089..210c702ce 100644 --- a/functions/fix_ins.sh +++ b/functions/fix_ins.sh @@ -17,4 +17,3 @@ if [ "${function_selfname}" == "command_debug.sh" ]; then else defaultmap="\\\"${defaultmap}\\\"" fi -fn_parms From 10dbf68f17897b25d00846f796aee162c9d5bc70 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Jan 2016 21:03:37 +0000 Subject: [PATCH 02/22] Initial code to detect missing deps This code is still broken --- functions/check.sh | 10 ++++++- functions/check_deps.sh | 55 +++++++++++++++++++++++++++++++++++++ functions/core_functions.sh | 7 ++++- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 functions/check_deps.sh diff --git a/functions/check.sh b/functions/check.sh index 150a8e138..ca50777cc 100644 --- a/functions/check.sh +++ b/functions/check.sh @@ -2,7 +2,7 @@ # LGSM fn_check function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="060116" +lgsm_version="170116" # Description: Overall function for managing checks. # Runs checks that will either halt on or fix an issue. @@ -33,6 +33,14 @@ do fi done +local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh ) +for allowed_command in "${allowed_commands_array[@]}" +do + if [ "${allowed_command}" == "${function_selfname}" ]; then + check_deps.sh + fi +done + local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) for allowed_command in "${allowed_commands_array[@]}" do diff --git a/functions/check_deps.sh b/functions/check_deps.sh new file mode 100644 index 000000000..f438f7240 --- /dev/null +++ b/functions/check_deps.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# LGSM check_deps.sh function +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com + +# Description: Checks that the require dependencies are installed for LGSM + + +fn_deps_detector(){ +if [ -n "$(command -v dpkg-query)" ]; then + dpkg-query -W -f='${Status}' ${deptocheck} | grep -q -P '^install ok installed$'; + depstatus=$? +elif [ -n "$(command -v rpm)" ]; then + rpm -qa ${deptocheck} |grep -q -P ${deptocheck} + depstatus=$? +else + echo "Unknown OS" +fi + +} + +cd "${executabledir}" +if [ "${executable}" == "./hlds_run" ]; then + local depslist=( lib32gcc1 libstdc++6 libstdc++6:i386 ) + for deptocheck in "${depstocheck[@]}" + do + fn_deps_detector + done + # gold source lib32gcc1 libstdc++6 libstdc++6:i386 +elif [ "${executable}" == "./srcds_run" ]||[ "${executable}" == "./dabds.sh" ]||[ "${executable}" == "./srcds_run.sh" ]; then + local depslist=( lib32gcc1 libstdc++6 libstdc++6:i386 ) + for deptocheck in "${depstocheck[@]}" + do + fn_deps_detector + done + # source lib32gcc1 libstdc++6 libstdc++6:i386 +elif [ "${executable}" == "./server_linux32" ]; then + # lib32gcc1 libstdc++6 libstdc++6:i386 speex:i386 libtbb2 +elif [ "${executable}" == "./runSam3_DedicatedServer.sh" ]; then + # spark lib32gcc1 libstdc++6 libstdc++6:i386 +elif [ "${executable}" == "./7DaysToDie.sh" ]; then + # lib32gcc1 libstdc++6 libstdc++6:i386 telnet expect +elif [ "${executable}" == "./ucc-bin" ]; then + + if [ -f "${executabledir}/ucc-bin-real" ]; then + executable=ucc-bin-real + elif [ -f "${executabledir}/ut2004-bin" ]; then + executable=ut2004-bin + else + executable=ut-bin + fi + +elif [ "${executable}" == "./ts3server_startscript.sh" ]; then + executable=ts3server_linux_amd64 +fi \ No newline at end of file diff --git a/functions/core_functions.sh b/functions/core_functions.sh index 560a2ee26..7b0f148cd 100644 --- a/functions/core_functions.sh +++ b/functions/core_functions.sh @@ -2,7 +2,7 @@ # LGSM core_functions.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="060116" +lgsm_version="170116" # Description: Defines all functions to allow download and execution of functions using fn_runfunction. # This function is called first before any other function. Without this file other functions would not load. @@ -111,6 +111,11 @@ functionfile="${FUNCNAME}" fn_runfunction } +check_deps.sh(){ +functionfile="${FUNCNAME}" +fn_runfunction +} + check_ip.sh(){ functionfile="${FUNCNAME}" fn_runfunction From 708448b02064bc2869978b94cb12b5ba4b365d73 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 23 Jan 2016 07:51:57 +0000 Subject: [PATCH 03/22] added jc2server --- functions/check_deps.sh | 97 +++++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index f438f7240..a92f67bf4 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -2,54 +2,77 @@ # LGSM check_deps.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com +lgsm_version="170116" # Description: Checks that the require dependencies are installed for LGSM fn_deps_detector(){ +# Checks is dependency is missing if [ -n "$(command -v dpkg-query)" ]; then - dpkg-query -W -f='${Status}' ${deptocheck} | grep -q -P '^install ok installed$'; + dpkg-query -W -f='${Status}' ${deptocheck} | grep -q -P '^install ok installed$' depstatus=$? -elif [ -n "$(command -v rpm)" ]; then - rpm -qa ${deptocheck} |grep -q -P ${deptocheck} - depstatus=$? -else - echo "Unknown OS" + if [ "${depstatus}" == "0" ]; then + missingdep=0 + echo -en " \e[0;32m${deptocheck}\e[0m" + else + # if missing dependency is flagged + missingdep=1 + echo -en " \e[0;31m${deptocheck}\e[0m" + fi + sleep 0.5 +fi + +# Add missing dependencies are added to array_deps_missing array +if [ "${missingdep}" == "1" ]; then + array_deps_missing+=("${deptocheck}") fi +} +fn_deps_email(){ +# Adds postfix to required dependencies if email notification is enabled +if [ "${emailnotification}" == "on" ]; then + array_deps_required+=("mailutils postfix") +fi } + cd "${executabledir}" -if [ "${executable}" == "./hlds_run" ]; then - local depslist=( lib32gcc1 libstdc++6 libstdc++6:i386 ) - for deptocheck in "${depstocheck[@]}" - do - fn_deps_detector - done - # gold source lib32gcc1 libstdc++6 libstdc++6:i386 -elif [ "${executable}" == "./srcds_run" ]||[ "${executable}" == "./dabds.sh" ]||[ "${executable}" == "./srcds_run.sh" ]; then - local depslist=( lib32gcc1 libstdc++6 libstdc++6:i386 ) - for deptocheck in "${depstocheck[@]}" - do - fn_deps_detector - done - # source lib32gcc1 libstdc++6 libstdc++6:i386 -elif [ "${executable}" == "./server_linux32" ]; then - # lib32gcc1 libstdc++6 libstdc++6:i386 speex:i386 libtbb2 -elif [ "${executable}" == "./runSam3_DedicatedServer.sh" ]; then - # spark lib32gcc1 libstdc++6 libstdc++6:i386 -elif [ "${executable}" == "./7DaysToDie.sh" ]; then - # lib32gcc1 libstdc++6 libstdc++6:i386 telnet expect -elif [ "${executable}" == "./ucc-bin" ]; then - - if [ -f "${executabledir}/ucc-bin-real" ]; then - executable=ucc-bin-real - elif [ -f "${executabledir}/ut2004-bin" ]; then - executable=ut2004-bin - else - executable=ut-bin - fi +# Generate array of missing deps +array_deps_missing=() +fn_printdots "Checking for missing dependencies:" +if [ "${executable}" == "./srcds_run" ]||[ "${executable}" == "./dabds.sh" ]||[ "${executable}" == "./srcds_run.sh" ]||[ "${executable}" == "./Jcmp-Server" ] ; then + local array_deps_required=( tmux curl lib32gcc1 libstdc++6:i386 ) + fn_deps_email +elif +else + fn_printfail "Unknown executable" + exit +fi -elif [ "${executable}" == "./ts3server_startscript.sh" ]; then - executable=ts3server_linux_amd64 +# Loop though required depenencies +for deptocheck in "${array_deps_required[@]}" +do + fn_deps_detector +done + +if [ "${#array_deps_missing[@]}" != "0" ]; then + fn_printwarnnl "Dependency Missing: \e[0;31m${array_deps_missing[@]}\e[0m" + sleep 2 + sudo -n true + if [ $? -eq 0 ]; then + fn_printinfonl "Attempting to install missing dependencies automatically" + echo -en ".\r" + sleep 1 + echo -en "..\r" + sleep 1 + echo -en "...\r" + sleep 1 + echo -en " \r" + sudo apt-get install ${array_deps_missing[@]} + else + echo "sudo apt-get install ${array_deps_missing[@]}" + fi +else + fn_printoknl "Checking for missing dependencies" fi \ No newline at end of file From 9da2c79acf852c21045b1d2371052ac83aa710d1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 23 Jan 2016 07:52:44 +0000 Subject: [PATCH 04/22] removed elif --- functions/check_deps.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index a92f67bf4..da297dc26 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -43,8 +43,7 @@ array_deps_missing=() fn_printdots "Checking for missing dependencies:" if [ "${executable}" == "./srcds_run" ]||[ "${executable}" == "./dabds.sh" ]||[ "${executable}" == "./srcds_run.sh" ]||[ "${executable}" == "./Jcmp-Server" ] ; then local array_deps_required=( tmux curl lib32gcc1 libstdc++6:i386 ) - fn_deps_email -elif + fn_deps_email else fn_printfail "Unknown executable" exit From aaab05c2a6d0bc99a620e363951ef666881ac82d Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 23 Jan 2016 16:21:45 +0100 Subject: [PATCH 05/22] inssserver workshop support steam workshop is working with insurgency on linux now --- Insurgency/insserver | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Insurgency/insserver b/Insurgency/insserver index e43d5e752..66e511149 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -31,10 +31,11 @@ sourcetvport="27020" clientport="27005" ip="0.0.0.0" updateonstart="off" +workshop="0" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} +sv_workshop_enabled ${workshop}" } #### Advanced Variables #### From c05af4209d4bb7d57824df7579d2a930ab7b6c39 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 25 Jan 2016 01:24:04 -0500 Subject: [PATCH 06/22] adding Sven Coop 5.0 --- SvenCoop/cfg/lgsm-default.cfg | 36 +++++++++ SvenCoop/svncoopserver.sh | 137 ++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 SvenCoop/cfg/lgsm-default.cfg create mode 100644 SvenCoop/svncoopserver.sh diff --git a/SvenCoop/cfg/lgsm-default.cfg b/SvenCoop/cfg/lgsm-default.cfg new file mode 100644 index 000000000..8cbca0f3d --- /dev/null +++ b/SvenCoop/cfg/lgsm-default.cfg @@ -0,0 +1,36 @@ +//---------------------------------------------- +// Sven Co-op v5.0 Default Server CFG +//---------------------------------------------- + +//---------------------------------------------- +// See server_example.cfg for more available +// commands and settings. +//---------------------------------------------- + +hostname "Sven Co-op 5.0 server" +log "on" + +//rcon_password "" +//sv_password "" + +sys_ticrate 100 +deathmatch 1 +decalfrequency 30 +hpk_maxsize 2 +pausable 0 + +sv_aim 0 +sv_allowdownload 1 +sv_allowupload 1 +sv_region 255 +sv_send_resources 1 +sv_voicecodec "voice_speex" +sv_voiceenable 1 +sv_voicequality 5 + +mp_telefrag 1 +mp_timelimit 99 +mp_weaponstay 1 + +exec banned.cfg +exec listip.cfg \ No newline at end of file diff --git a/SvenCoop/svncoopserver.sh b/SvenCoop/svncoopserver.sh new file mode 100644 index 000000000..0d20d9c39 --- /dev/null +++ b/SvenCoop/svncoopserver.sh @@ -0,0 +1,137 @@ +#!/bin/bash +# Sven Co-op +# Server Management Script +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="271215" + +#### Variables #### + +# Notification Email +# (on|off) +emailnotification="off" +email="email@example.com" + +# Steam login +steamuser="anonymous" +steampass="" + +# Start Variables +defaultmap="stadium4" +maxplayers="16" +port="27015" +clientport="27005" +ip="0.0.0.0" +updateonstart="off" + +# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 +fn_parms(){ +parms="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +} + +#### 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" + +# Steam +appid="276060" + +# Server Details +servicename="svencoop-server" +gamename="Sven Co-op" +engine="goldsource" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}/svencoop" +executabledir="${filesdir}" +executable="./svends_run" +servercfg="${servicename}.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.cfg" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${systemdir}/logs" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" + +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" + +##### Script ##### +# Do not edit + +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" + fi + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + : + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curl}" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" +fi +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 +} + +core_functions.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_runfunction +} + +core_functions.sh + +getopt=$1 +core_getopt.sh \ No newline at end of file From 59ab5e29bd7861b246f0a25e26770ada36ea14a1 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 25 Jan 2016 01:45:15 -0500 Subject: [PATCH 07/22] rename --- SvenCoop/{svncoopserver.sh => svncoopserver} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename SvenCoop/{svncoopserver.sh => svncoopserver} (98%) diff --git a/SvenCoop/svncoopserver.sh b/SvenCoop/svncoopserver similarity index 98% rename from SvenCoop/svncoopserver.sh rename to SvenCoop/svncoopserver index 0d20d9c39..f4abfc4c5 100644 --- a/SvenCoop/svncoopserver.sh +++ b/SvenCoop/svncoopserver @@ -23,7 +23,7 @@ steamuser="anonymous" steampass="" # Start Variables -defaultmap="stadium4" +defaultmap="svencoop1" maxplayers="16" port="27015" clientport="27005" From 2cfddcdfa7ed3637c6ebd6810c0827e7bc48c895 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 25 Jan 2016 01:46:46 -0500 Subject: [PATCH 08/22] rename --- SvenCoop/{svncoopserver => svencoopserver} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename SvenCoop/{svncoopserver => svencoopserver} (100%) diff --git a/SvenCoop/svncoopserver b/SvenCoop/svencoopserver similarity index 100% rename from SvenCoop/svncoopserver rename to SvenCoop/svencoopserver From 9042481f122ee17b7d38a0ba05f61f4361c6fb63 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 25 Jan 2016 02:16:46 -0500 Subject: [PATCH 09/22] update default config --- SvenCoop/cfg/lgsm-default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SvenCoop/cfg/lgsm-default.cfg b/SvenCoop/cfg/lgsm-default.cfg index 8cbca0f3d..6bc0822bc 100644 --- a/SvenCoop/cfg/lgsm-default.cfg +++ b/SvenCoop/cfg/lgsm-default.cfg @@ -7,10 +7,10 @@ // commands and settings. //---------------------------------------------- -hostname "Sven Co-op 5.0 server" +hostname "" log "on" -//rcon_password "" +rcon_password "" //sv_password "" sys_ticrate 100 From 40640285dc20da426e881e7df606ed7bf5b33d5d Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Tue, 26 Jan 2016 02:26:41 -0500 Subject: [PATCH 10/22] fix for hldm + adding goldeneyesource + svencoop --- functions/install_config.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/functions/install_config.sh b/functions/install_config.sh index 142a680e2..5ccccd80a 100644 --- a/functions/install_config.sh +++ b/functions/install_config.sh @@ -225,14 +225,19 @@ elif [ "${gamename}" == "Garry's Mod" ]; then wget -N /dev/null ${githuburl}/GarrysMod/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_sourceconfig +elif [ "${gamename}" == "GoldenEye: Source" ]; then + echo -e "downloading lgsm-default.cfg...\c" + wget -N /dev/null ${githuburl}/GoldenEyeSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_sourceconfig elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then echo -e "downloading lgsm-default.cfg...\c" wget -N /dev/null ${githuburl}/HalfLife2Deathmatch/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_sourceconfig -elif [ "${gamename}" == "Half Life: Deathmatch Classic" ]; then +elif [ "${gamename}" == "Half Life: Deathmatch" ]; then echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/HalfLifeDeathmatchClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq + wget -N /dev/null ${githuburl}/HalfLifeDeathmatch/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_goldsourceconfig elif [ "${gamename}" == "Insurgency" ]; then @@ -275,6 +280,11 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then wget -N /dev/null ${githuburl}/SeriousSam3BFE/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_serious3config +elif [ "${gamename}" == "Sven Co-op" ]; then + echo -e "downloading lgsm-default.cfg...\c" + wget -N /dev/null ${githuburl}/SvenCoop/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_goldsourceconfig elif [ "${gamename}" == "Teamspeak 3" ]; then echo -e "downloading lgsm-default.ini...\c" wget -N /dev/null ${githuburl}/TeamSpeak3/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq From bf3fda25b03c266488980a50b349403b139ab64b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 20:07:30 +0000 Subject: [PATCH 11/22] Altered script log messages slightly --- functions/check_deps.sh | 106 ++++++++++++++++++++++++---------- functions/fn_update_functions | 6 +- functions/update_check.sh | 1 - functions/update_functions.sh | 6 +- 4 files changed, 82 insertions(+), 37 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index da297dc26..b279dc026 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -2,7 +2,7 @@ # LGSM check_deps.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="170116" +lgsm_version="310116" # Description: Checks that the require dependencies are installed for LGSM @@ -10,17 +10,14 @@ lgsm_version="170116" fn_deps_detector(){ # Checks is dependency is missing if [ -n "$(command -v dpkg-query)" ]; then - dpkg-query -W -f='${Status}' ${deptocheck} | grep -q -P '^install ok installed$' + dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null| grep -q -P '^install ok installed$' depstatus=$? if [ "${depstatus}" == "0" ]; then missingdep=0 - echo -en " \e[0;32m${deptocheck}\e[0m" else # if missing dependency is flagged missingdep=1 - echo -en " \e[0;31m${deptocheck}\e[0m" fi - sleep 0.5 fi # Add missing dependencies are added to array_deps_missing array @@ -32,33 +29,18 @@ fi fn_deps_email(){ # Adds postfix to required dependencies if email notification is enabled if [ "${emailnotification}" == "on" ]; then - array_deps_required+=("mailutils postfix") + array_deps_required+=( mailutils postfix ) fi } - -cd "${executabledir}" -# Generate array of missing deps -array_deps_missing=() -fn_printdots "Checking for missing dependencies:" -if [ "${executable}" == "./srcds_run" ]||[ "${executable}" == "./dabds.sh" ]||[ "${executable}" == "./srcds_run.sh" ]||[ "${executable}" == "./Jcmp-Server" ] ; then - local array_deps_required=( tmux curl lib32gcc1 libstdc++6:i386 ) - fn_deps_email -else - fn_printfail "Unknown executable" - exit -fi - -# Loop though required depenencies -for deptocheck in "${array_deps_required[@]}" -do - fn_deps_detector -done - +fn_found_missing_deps(){ if [ "${#array_deps_missing[@]}" != "0" ]; then - fn_printwarnnl "Dependency Missing: \e[0;31m${array_deps_missing[@]}\e[0m" + fn_printdots "Checking dependencies" sleep 2 - sudo -n true + fn_printwarn "Checking dependencies: Dependency missing: \e[0;31m${array_deps_missing[@]}\e[0m" + sleep 1 + echo -e "" + sudo -n true > /dev/null 2>&1 if [ $? -eq 0 ]; then fn_printinfonl "Attempting to install missing dependencies automatically" echo -en ".\r" @@ -69,9 +51,73 @@ if [ "${#array_deps_missing[@]}" != "0" ]; then sleep 1 echo -en " \r" sudo apt-get install ${array_deps_missing[@]} + exit 1 else + echo "" + fn_printinfomationnl "$(whoami) does not have sudo access. manually install dependencies" + echo "" echo "sudo apt-get install ${array_deps_missing[@]}" - fi -else - fn_printoknl "Checking for missing dependencies" + echo "" + exit 1 + fi +fi +} + + + +# Check will only run if using apt-get or yum +if [ -n "$(command -v dpkg-query)" ]; then + # Generate array of missing deps + array_deps_missing=() + fn_printdots "Checking dependencies" + + # LGSM requirement for curl + local array_deps_required=( curl ) + + # All servers except ts3 require tmux + if [ "${executable}" != "./ts3server_startscript.sh" ]; then + local array_deps_required+=( tmux ) + fi + + # All servers excelts ts3 & mumble require libstdc++6,lib32gcc1 + if [ "${executable}" != "./ts3server_startscript.sh" ]||[ "${executable}" != "./murmur.x86" ]; then + local array_deps_required+=( lib32gcc1 libstdc++6:i386 ) + fi + +# Game Specific requirements + + # Spark + if [ "${engine}" == "spark" ]; then + local array_deps_required+=( speex:i386 libtbb2 ) + # 7 Days to Die + elif [ "${executable}" == "./7DaysToDie.sh" ]; then + local array_deps_required+=( telnet expect ) + # Brainbread 2 and Don't Starve Together + elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then + local array_deps_required+=( libcurl4-gnutls-dev:i386 ) + if [ "${engine}" == "projectzomboid" ]; then + local array_deps_required+=( openjdk-7-jre ) + # Unreal engine + elif [ "${executable}" == "./ucc-bin" ]; then + #UT2K4 + if [ -f "${executabledir}/ut2004-bin" ]; then + local array_deps_required+=( libsdl1.2debian libstdc++5:i386 bzip2 unzip ) + #UT99 + else + local array_deps_required+=( libsdl1.2debian bzip2 ) + fi + else + fn_printfail "Unknown executable" + exit + fi + fn_deps_email + + # Loop though required depenencies + for deptocheck in "${array_deps_required[@]}" + do + fn_deps_detector + done + + # user to be informaed of any missing dependecies + fn_found_missing_deps fi \ No newline at end of file diff --git a/functions/fn_update_functions b/functions/fn_update_functions index 185f44f5e..2de9afd6d 100644 --- a/functions/fn_update_functions +++ b/functions/fn_update_functions @@ -2,7 +2,7 @@ # LGSM update_functions.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="271215" +lgsm_version="230116" # Description: LEGACY FUNCTION Deletes the functions dir to allow re-downloading of functions from GitHub. @@ -14,9 +14,9 @@ rm -rfv "${rootdir}/functions/"* exitcode=$? if [ "${exitcode}" == "0" ]; then fn_printok "Updating functions" - fn_scriptlog "Successfull! Updating functions" + fn_scriptlog "Success! Updating functions" else - fn_printokfail "Updating functions" + fn_printfail "Updating functions" fn_scriptlog "Failure! Updating functions" fi echo -ne "\n" \ No newline at end of file diff --git a/functions/update_check.sh b/functions/update_check.sh index e0ba3ea96..38e786544 100644 --- a/functions/update_check.sh +++ b/functions/update_check.sh @@ -188,7 +188,6 @@ sleep 1 # Checks currentbuild info is available, if fails a server restart will be forced to generate logs if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then fn_printfail "Checking for update: teamspeak.com" - fn_scriptlog "Checking for update: teamspeak.com" sleep 1 fn_printfailnl "Checking for update: teamspeak.com: No logs with server version found" fn_scriptlog "Failure! Checking for update: teamspeak.com: No logs with server version found" diff --git a/functions/update_functions.sh b/functions/update_functions.sh index 350714ed0..196b90f75 100644 --- a/functions/update_functions.sh +++ b/functions/update_functions.sh @@ -2,7 +2,7 @@ # LGSM update_functions.sh function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -lgsm_version="271215" +lgsm_version="230116" # Description: Deletes the functions dir to allow re-downloading of functions from GitHub. @@ -16,9 +16,9 @@ rm -rfv "${rootdir}/functions/"* exitcode=$? if [ "${exitcode}" == "0" ]; then fn_printok "Updating functions" - fn_scriptlog "Successfull! Updating functions" + fn_scriptlog "Success! Updating functions" else - fn_printokfail "Updating functions" + fn_printfail "Updating functions" fn_scriptlog "Failure! Updating functions" fi echo -ne "\n" \ No newline at end of file From 70a5b460d8c3f69c517b348819f216a4fbb82588 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 20:14:23 +0000 Subject: [PATCH 12/22] removed local --- functions/check_deps.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index b279dc026..fabdf81b5 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -72,39 +72,39 @@ if [ -n "$(command -v dpkg-query)" ]; then fn_printdots "Checking dependencies" # LGSM requirement for curl - local array_deps_required=( curl ) + array_deps_required=( curl ) # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then - local array_deps_required+=( tmux ) + array_deps_required+=( tmux ) fi # All servers excelts ts3 & mumble require libstdc++6,lib32gcc1 if [ "${executable}" != "./ts3server_startscript.sh" ]||[ "${executable}" != "./murmur.x86" ]; then - local array_deps_required+=( lib32gcc1 libstdc++6:i386 ) + array_deps_required+=( lib32gcc1 libstdc++6:i386 ) fi # Game Specific requirements # Spark if [ "${engine}" == "spark" ]; then - local array_deps_required+=( speex:i386 libtbb2 ) + array_deps_required+=( speex:i386 libtbb2 ) # 7 Days to Die elif [ "${executable}" == "./7DaysToDie.sh" ]; then - local array_deps_required+=( telnet expect ) + array_deps_required+=( telnet expect ) # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then - local array_deps_required+=( libcurl4-gnutls-dev:i386 ) - if [ "${engine}" == "projectzomboid" ]; then - local array_deps_required+=( openjdk-7-jre ) + array_deps_required+=( libcurl4-gnutls-dev:i386 ) + elif [ "${engine}" == "projectzomboid" ]; then + array_deps_required+=( openjdk-7-jre ) # Unreal engine elif [ "${executable}" == "./ucc-bin" ]; then #UT2K4 if [ -f "${executabledir}/ut2004-bin" ]; then - local array_deps_required+=( libsdl1.2debian libstdc++5:i386 bzip2 unzip ) + array_deps_required+=( libsdl1.2debian libstdc++5:i386 bzip2 unzip ) #UT99 else - local array_deps_required+=( libsdl1.2debian bzip2 ) + array_deps_required+=( libsdl1.2debian bzip2 ) fi else fn_printfail "Unknown executable" From 1e0c80fb1804f4997c789cbf3e286c02ff99ba6c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 20:20:03 +0000 Subject: [PATCH 13/22] Removed unknown exec if --- functions/check_deps.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index fabdf81b5..6a48f7214 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -105,10 +105,7 @@ if [ -n "$(command -v dpkg-query)" ]; then #UT99 else array_deps_required+=( libsdl1.2debian bzip2 ) - fi - else - fn_printfail "Unknown executable" - exit + fi fi fn_deps_email From fa5dfc64b310d2275c47a128ec659fd220ab6336 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 21:35:45 +0000 Subject: [PATCH 14/22] Added CentOS Support --- functions/check_deps.sh | 93 ++++++++++++++++++++++++++++++++++------- 1 file changed, 79 insertions(+), 14 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index 6a48f7214..0e21baef8 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -12,6 +12,10 @@ fn_deps_detector(){ if [ -n "$(command -v dpkg-query)" ]; then 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} 2>/dev/null + depstatus=$? +fi if [ "${depstatus}" == "0" ]; then missingdep=0 else @@ -29,7 +33,11 @@ fi fn_deps_email(){ # Adds postfix to required dependencies if email notification is enabled if [ "${emailnotification}" == "on" ]; then - array_deps_required+=( mailutils postfix ) + if [ -n "$(command -v dpkg-query)" ]; then + array_deps_required+=( mailutils postfix ) + elif [ -n "$(command -v yum)" ]; then + array_deps_required+=( mailx postfix ) + fi fi } @@ -50,20 +58,35 @@ if [ "${#array_deps_missing[@]}" != "0" ]; then echo -en "...\r" sleep 1 echo -en " \r" - sudo apt-get install ${array_deps_missing[@]} - exit 1 + if [ -n "$(command -v dpkg-query)" ]; then + echo "sudo apt-get install ${array_deps_missing[@]}" + elif [ -n "$(command -v yum)" ]; then + echo "yum install ${array_deps_missing[@]}" + fi else echo "" fn_printinfomationnl "$(whoami) does not have sudo access. manually install dependencies" echo "" - echo "sudo apt-get install ${array_deps_missing[@]}" + if [ -n "$(command -v dpkg-query)" ]; then + echo "sudo apt-get install ${array_deps_missing[@]}" + elif [ -n "$(command -v yum)" ]; then + echo "yum install ${array_deps_missing[@]}" + fi echo "" - exit 1 fi fi } +fn_check_loop(){ + # Loop though required depenencies + for deptocheck in "${array_deps_required[@]}" + do + fn_deps_detector + done + # user to be informaed of any missing dependecies + fn_found_missing_deps +} # Check will only run if using apt-get or yum if [ -n "$(command -v dpkg-query)" ]; then @@ -72,7 +95,7 @@ if [ -n "$(command -v dpkg-query)" ]; then fn_printdots "Checking dependencies" # LGSM requirement for curl - array_deps_required=( curl ) + array_deps_required=( curl ca-certificates ) # All servers except ts3 require tmux if [ "${executable}" != "./ts3server_startscript.sh" ]; then @@ -84,7 +107,7 @@ if [ -n "$(command -v dpkg-query)" ]; then array_deps_required+=( lib32gcc1 libstdc++6:i386 ) fi -# Game Specific requirements + # Game Specific requirements # Spark if [ "${engine}" == "spark" ]; then @@ -92,6 +115,9 @@ if [ -n "$(command -v dpkg-query)" ]; then # 7 Days to Die elif [ "${executable}" == "./7DaysToDie.sh" ]; then array_deps_required+=( telnet expect ) + # No More Room in Hell + elif [ "${gamename}" == "No More Room in Hell" ] + array_deps_required+=( lib32tinfo5 ) # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then array_deps_required+=( libcurl4-gnutls-dev:i386 ) @@ -108,13 +134,52 @@ if [ -n "$(command -v dpkg-query)" ]; then fi fi fn_deps_email + fn_check_loop - # Loop though required depenencies - for deptocheck in "${array_deps_required[@]}" - do - fn_deps_detector - done +elif [ -n "$(command -v yum)" ]; then + # Generate array of missing deps + array_deps_missing=() + fn_printdots "Checking dependencies" - # user to be informaed of any missing dependecies - fn_found_missing_deps + # LGSM requirement for curl + array_deps_required=( curl ) + + # All servers except ts3 require tmux + if [ "${executable}" != "./ts3server_startscript.sh" ]; then + array_deps_required+=( tmux ) + fi + + # All servers excelts ts3 & mumble require libstdc++6,lib32gcc1 + if [ "${executable}" != "./ts3server_startscript.sh" ]||[ "${executable}" != "./murmur.x86" ]; then + array_deps_required+=( glibc.i686 libstdc++.i686 ) + fi + + # Game Specific requirements + + # Spark + if [ "${engine}" == "spark" ]; then + array_deps_required+=( speex.i686 tbb.i686 ) + # 7 Days to Die + elif [ "${executable}" == "./7DaysToDie.sh" ]; then + array_deps_required+=( telnet expect ) + # No More Room in Hell + elif [ "${gamename}" == "No More Room in Hell" ] + array_deps_required+=( ncurses-libs.i686 ) + # Brainbread 2 and Don't Starve Together + elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then + array_deps_required+=( libcurl.i686 ) + elif [ "${engine}" == "projectzomboid" ]; then + array_deps_required+=( java-1.7.0-openjdk ) + # Unreal engine + elif [ "${executable}" == "./ucc-bin" ]; then + #UT2K4 + if [ -f "${executabledir}/ut2004-bin" ]; then + array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 unzip ) + #UT99 + else + array_deps_required+=( SDL.i686 bzip2 ) + fi + fi + fn_deps_email + fn_check_loop fi \ No newline at end of file From 94af491dfe43011136b8e5ef06feded04842f722 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 21:53:43 +0000 Subject: [PATCH 15/22] removed stray fi --- functions/check_deps.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index 0e21baef8..94899b20b 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -16,12 +16,11 @@ elif [ -n "$(command -v yum)" ]; then yum -q list installed ${deptocheck} 2>/dev/null depstatus=$? fi - if [ "${depstatus}" == "0" ]; then - missingdep=0 - else - # if missing dependency is flagged - missingdep=1 - fi +if [ "${depstatus}" == "0" ]; then + missingdep=0 +else + # if missing dependency is flagged + missingdep=1 fi # Add missing dependencies are added to array_deps_missing array From 288072bc866c6836e922158b07adda635d9612b8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 22:04:51 +0000 Subject: [PATCH 16/22] added missing then --- functions/check_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index 94899b20b..07f67d719 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -115,7 +115,7 @@ if [ -n "$(command -v dpkg-query)" ]; then elif [ "${executable}" == "./7DaysToDie.sh" ]; then array_deps_required+=( telnet expect ) # No More Room in Hell - elif [ "${gamename}" == "No More Room in Hell" ] + elif [ "${gamename}" == "No More Room in Hell" ]; then array_deps_required+=( lib32tinfo5 ) # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then @@ -162,7 +162,7 @@ elif [ -n "$(command -v yum)" ]; then elif [ "${executable}" == "./7DaysToDie.sh" ]; then array_deps_required+=( telnet expect ) # No More Room in Hell - elif [ "${gamename}" == "No More Room in Hell" ] + elif [ "${gamename}" == "No More Room in Hell" ]; then array_deps_required+=( ncurses-libs.i686 ) # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then From f77bfa5b1b623f26eedf0d3cb1710fa0579bfb6d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 22:13:17 +0000 Subject: [PATCH 17/22] dev/null --- functions/check_deps.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index 07f67d719..14b1d71c3 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -13,7 +13,7 @@ if [ -n "$(command -v dpkg-query)" ]; then 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} 2>/dev/null + yum -q list installed ${deptocheck} > /dev/null 2>&1 depstatus=$? fi if [ "${depstatus}" == "0" ]; then @@ -91,7 +91,6 @@ fn_check_loop(){ if [ -n "$(command -v dpkg-query)" ]; then # Generate array of missing deps array_deps_missing=() - fn_printdots "Checking dependencies" # LGSM requirement for curl array_deps_required=( curl ca-certificates ) @@ -138,7 +137,6 @@ if [ -n "$(command -v dpkg-query)" ]; then elif [ -n "$(command -v yum)" ]; then # Generate array of missing deps array_deps_missing=() - fn_printdots "Checking dependencies" # LGSM requirement for curl array_deps_required=( curl ) From 6af31e04375bb93229f5ff61e6ba1d9aec1f3425 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 22:16:32 +0000 Subject: [PATCH 18/22] added add arch --- functions/check_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index 14b1d71c3..11a76d54b 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -58,7 +58,7 @@ if [ "${#array_deps_missing[@]}" != "0" ]; then sleep 1 echo -en " \r" if [ -n "$(command -v dpkg-query)" ]; then - echo "sudo apt-get install ${array_deps_missing[@]}" + echo "sudo dpkg --add-architecture i386; sudo apt-get install ${array_deps_missing[@]}" elif [ -n "$(command -v yum)" ]; then echo "yum install ${array_deps_missing[@]}" fi @@ -67,7 +67,7 @@ if [ "${#array_deps_missing[@]}" != "0" ]; then fn_printinfomationnl "$(whoami) does not have sudo access. manually install dependencies" echo "" if [ -n "$(command -v dpkg-query)" ]; then - echo "sudo apt-get install ${array_deps_missing[@]}" + echo "sudo dpkg --add-architecture i386; sudo apt-get install ${array_deps_missing[@]}" elif [ -n "$(command -v yum)" ]; then echo "yum install ${array_deps_missing[@]}" fi From e561a86acdce50ff1758feaf3cfdafe1800ca15a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 22:46:06 +0000 Subject: [PATCH 19/22] Added to installer --- functions/check_deps.sh | 14 ++++++++++---- functions/command_install.sh | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index 11a76d54b..d14d813bb 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -4,11 +4,11 @@ # Website: http://gameservermanagers.com lgsm_version="310116" -# Description: Checks that the require dependencies are installed for LGSM +# Description: Checks that the requires dependencies are installed for LGSM. fn_deps_detector(){ -# Checks is dependency is missing +# 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$' depstatus=$? @@ -19,11 +19,11 @@ fi if [ "${depstatus}" == "0" ]; then missingdep=0 else - # if missing dependency is flagged + # if missing dependency is found missingdep=1 fi -# Add missing dependencies are added to array_deps_missing array +# Missing dependencies are added to array_deps_missing if [ "${missingdep}" == "1" ]; then array_deps_missing+=("${deptocheck}") fi @@ -87,6 +87,12 @@ fn_check_loop(){ fn_found_missing_deps } +if [ "${function_selfname}" == "command_install.sh" ]; then +echo "Server Directory" +echo "=================================" +fi + + # Check will only run if using apt-get or yum if [ -n "$(command -v dpkg-query)" ]; then # Generate array of missing deps diff --git a/functions/command_install.sh b/functions/command_install.sh index f2021f071..791cb160d 100644 --- a/functions/command_install.sh +++ b/functions/command_install.sh @@ -9,7 +9,7 @@ function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh install_header.sh install_serverdir.sh - +check_deps.sh # Download and install if [ "${gamename}" == "Unreal Tournament 2004" ]; then install_dl_ut2k4.sh From 5906e07c01001e5674610d43d58f2f7edcf53150 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 22:47:35 +0000 Subject: [PATCH 20/22] Added installer mode --- functions/check_deps.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index d14d813bb..2224ea2f4 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -18,9 +18,13 @@ elif [ -n "$(command -v yum)" ]; then fi if [ "${depstatus}" == "0" ]; then missingdep=0 + echo -e "\e[0;32m${deptocheck}\e[0m" + sleep 0.5 else # if missing dependency is found missingdep=1 + echo -e "\e[0;31m${deptocheck}\e[0m" + sleep 0.5 fi # Missing dependencies are added to array_deps_missing @@ -88,8 +92,9 @@ fn_check_loop(){ } if [ "${function_selfname}" == "command_install.sh" ]; then -echo "Server Directory" -echo "=================================" + echo "" + echo "Checking Dependecies" + echo "=================================" fi From a3c917d3b77115a5f723c87856d4a67ec9e3c06a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 31 Jan 2016 22:48:13 +0000 Subject: [PATCH 21/22] added if --- functions/check_deps.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index 2224ea2f4..cf685d3a1 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -18,13 +18,17 @@ elif [ -n "$(command -v yum)" ]; then fi if [ "${depstatus}" == "0" ]; then missingdep=0 - echo -e "\e[0;32m${deptocheck}\e[0m" - sleep 0.5 + if [ "${function_selfname}" == "command_install.sh" ]; then + echo -e "\e[0;32m${deptocheck}\e[0m" + sleep 0.5 + fi else # if missing dependency is found missingdep=1 - echo -e "\e[0;31m${deptocheck}\e[0m" - sleep 0.5 + if [ "${function_selfname}" == "command_install.sh" ]; then + echo -e "\e[0;31m${deptocheck}\e[0m" + sleep 0.5 + fi fi # Missing dependencies are added to array_deps_missing From 26ca719fa456779063dec194f56934364c0fc085 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 1 Feb 2016 20:48:19 +0000 Subject: [PATCH 22/22] Add sleep for installer --- functions/check_deps.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index cf685d3a1..1e2e99fee 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -81,6 +81,9 @@ if [ "${#array_deps_missing[@]}" != "0" ]; then fi echo "" fi + if [ "${function_selfname}" == "command_install.sh" ]; then + sleep 5 + fi fi }