Просмотр исходного кода

tmux updates

removed check_tmux.sh as handled by check_deps
fixes handling of tmux for complied versions
Daniel Gibbs 9 лет назад
Родитель
Сommit
cdcc6290e5
3 измененных файлов с 7 добавлено и 36 удалено
  1. 1 9
      lgsm/functions/check.sh
  2. 6 6
      lgsm/functions/check_deps.sh
  3. 0 21
      lgsm/functions/check_tmux.sh

+ 1 - 9
lgsm/functions/check.sh

@@ -13,7 +13,7 @@ local commandname="CHECK"
 check_root.sh
 check_permissions.sh
 
-if [ "${function_selfname}" != "command_install.sh" ] && [ "${function_selfname}" != "command_update_functions.sh" ]; then
+if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]; then
 	check_system_dir.sh
 fi
 
@@ -59,14 +59,6 @@ do
 	fi
 done
 
-local allowed_commands_array=( command_console.sh command_start.sh )
-for allowed_command in "${allowed_commands_array[@]}"
-do
-	if [ "${allowed_command}" == "${function_selfname}" ]||[ "${gamename}" != "TeamSpeak 3" ]; then
-		check_tmux.sh
-	fi
-done
-
 local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do

+ 6 - 6
lgsm/functions/check_deps.sh

@@ -18,10 +18,10 @@ fn_deps_detector(){
 	if [ "${depstatus}" == "0" ]; then
 		missingdep=0
 		if [ "${function_selfname}" == "command_install.sh" ]; then
-			if [ "${tmuxcheck}" != "1" ]; then
+			if [ "${tmuxcheck}" == "1" ]; then
 				# Added for users compiling tmux from source to bypass rpm check
 				echo -e "${green}tmux${default}"
-				tmuxcheck=1
+				unset tmuxcheck
 			fi
 			echo -e "${green}${deptocheck}${default}"
 			sleep 0.5
@@ -142,8 +142,8 @@ if [ -n "$(command -v dpkg-query)" ]; then
 
 	# All servers except ts3 require tmux
 	if [ "${executable}" != "./ts3server_startscript.sh" ]; then
-		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
+		if [ "$(command -v tmux)" ]||[ "$(which tmux 2>/dev/null)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then
+			tmuxcheck=1 # Added for users compiling tmux from source to bypass rpm check
 		else
 			array_deps_required+=( tmux )
 		fi
@@ -201,8 +201,8 @@ elif [ -n "$(command -v yum)" ]; then
 
 	# All servers except ts3 require tmux
 	if [ "${executable}" != "./ts3server_startscript.sh" ]; then
-		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
+		if [ "$(command -v tmux)" ]||[ "$(which tmux 2>/dev/null)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then
+			tmuxcheck=1 # Added for users compiling tmux from source to bypass rpm check
 		else
 			array_deps_required+=( tmux )
 		fi

+ 0 - 21
lgsm/functions/check_tmux.sh

@@ -1,21 +0,0 @@
-#!/bin/bash
-# LGSM check_tmux.sh function
-# Author: Daniel Gibbs
-# Website: https://gameservermanagers.com
-# Description: Checks if tmux is installed as too many users do not RTFM or know how to use Google.
-
-local commandname="CHECK"
-local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-
-if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then
-	:
-else
-	fn_print_fail_nl "Tmux not installed"
-	sleep 1
-	fn_script_log_fatal "Tmux is not installed"
-	echo "	* Tmux is required to run this server."
-	# Suitable passive agressive message
-	echo "	* Please see the the following link."
-	echo "	* https://gameservermanagers.com/tmux-not-found"
-	core_exit.sh
-fi