Daniel Gibbs 10 лет назад
Родитель
Сommit
edaa4e2bc2

+ 13 - 5
lgsm/functions/check_deps.sh

@@ -72,7 +72,8 @@ fn_found_missing_deps(){
 		echo -e ""
 		sudo -n true > /dev/null 2>&1
 		if [ $? -eq 0 ]; then
-			fn_print_info_nl "Attempting to install missing dependencies automatically"
+			fn_print_infomation_nl "Attempting to install missing dependencies automatically"
+			fn_script_log_info "Attempting to install missing dependencies automatically"
 			echo -en ".\r"
 			sleep 1
 			echo -en "..\r"
@@ -82,15 +83,22 @@ fn_found_missing_deps(){
 			echo -en "   \r"
 			if [ -n "$(command -v dpkg-query)" ]; then
 				cmd="sudo dpkg --add-architecture i386; sudo apt-get -y install ${array_deps_missing[@]}"
-				eval $cmd
+				eval ${cmd}
 			elif [ -n "$(command -v yum)" ]; then
 				cmd="sudo yum -y install ${array_deps_missing[@]}"
-				eval $cmd
+				eval ${cmd}
+			fi
+			if [ $? != 0 ]; then
+				fn_print_failure_nl "Unable to install dependencies"
+				fn_script_log_fail "Unable to install dependencies"
+			else
+				fn_print_success_nl "install dependencies completed"
+				fn_script_log_pass "install dependencies completed"
 			fi
 		else
 			echo ""
-			fn_print_infomation_nl "$(whoami) does not have sudo access. Please manually install dependencies"
-			fn_script_log_info "$(whoami) does not have sudo access. Please manually install dependencies"
+			fn_print_warning_nl "$(whoami) does not have sudo access. Please manually install dependencies"
+			fn_script_log_warn "$(whoami) does not have sudo access. Please manually install dependencies"
 			echo ""
 			if [ -n "$(command -v dpkg-query)" ]; then
 				echo "sudo dpkg --add-architecture i386; sudo apt-get install ${array_deps_missing[@]}"

+ 2 - 2
lgsm/functions/check_glibc.sh

@@ -15,7 +15,7 @@ info_distro.sh
 if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
 	:
 elif [ "${glibcrequired}" == "UNKNOWN" ]; then
-		fn_print_info_nl "Glibc fix: ${red}${glibcrequired}${default}"
+		fn_print_error_nl "Glibc fix: ${red}${glibcrequired}${default}"
 		echo -e "	* glibc required: ${red}${glibcrequired}${default}"
 		echo -e "	* glibc installed: ${glibcversion}"
 elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
@@ -27,7 +27,7 @@ elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n
 			fix_glibc.sh
 		fi
 	else
-		fn_print_warn_nl "Glibc fix: ${red}No Glibc fix available!${default}"
+		fn_print_error_nl "Glibc fix: ${red}No Glibc fix available!${default}"
 		echo -en "\n"
 		echo -e "	* glibc required: ${glibcrequired}"
 		echo -e "	* glibc installed: ${red}${glibcversion}${default}"

+ 2 - 4
lgsm/functions/command_start.sh

@@ -23,8 +23,6 @@ fn_start_teamspeak3(){
 		sleep 5
 		touch "${servercfgfullpath}"
 	fi
-
-	fn_print_dots "${servername}"
 	sleep 1
 	check_status.sh
 	if [ "${status}" != "0" ]; then
@@ -57,8 +55,6 @@ fn_start_teamspeak3(){
 
 fn_start_tmux(){
 	fn_parms
-	fn_print_dots "${servername}"
-	sleep 1
 
 	# Log rotation
 	check_status.sh
@@ -166,6 +162,8 @@ fn_start_tmux(){
 	echo -en "\n"
 }
 
+fn_print_dots "${servername}"
+sleep 1
 check.sh
 fix.sh
 info_config.sh

+ 2 - 2
lgsm/functions/command_stop.sh

@@ -256,9 +256,9 @@ fn_stop_pre_check(){
 	fi
 }
 
-check.sh
-info_config.sh
 fn_print_dots "${servername}"
 sleep 1
+check.sh
+info_config.sh
 fn_stop_pre_check
 core_exit.sh

+ 1 - 0
lgsm/functions/command_test_alert.sh

@@ -8,6 +8,7 @@ local commandnane="ALERT"
 local commandaction="Alert"
 local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
+fn_print_dots "${servername}"
 check.sh
 info_config.sh
 alert="test"

+ 3 - 1
lgsm/functions/command_update.sh

@@ -8,9 +8,11 @@ local commandnane="UPDATE"
 local commandaction="Update"
 local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
+fn_print_dots "Checking for update"
+sleep 1
 check.sh
 
-fn_print_dots "Checking for update"
+
 if [ "${gamename}" == "Teamspeak 3" ]; then
 	update_ts3.sh
 elif [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then

+ 3 - 2
lgsm/functions/command_update_functions.sh

@@ -6,10 +6,11 @@
 
 local commandaction="Update LGSM"
 local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
-check.sh
+
 fn_print_dots "Updating functions"
-fn_script_log_info "Updating functions"
 sleep 1
+check.sh
+fn_script_log_info "Updating functions"
 echo -ne "\n"
 
 # Removed legecy functions dir

+ 3 - 2
lgsm/functions/command_validate.sh

@@ -13,8 +13,6 @@ fn_validation(){
 	echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate"
 	sleep 5
 	echo -en "\n"
-	fn_print_dots "Checking server files"
-	sleep 1
 	fn_print_ok "Checking server files"
 	fn_script_log_info "Checking server files"
 	sleep 1
@@ -35,6 +33,9 @@ fn_validation(){
 	fn_script_log_info "Checking complete"
 }
 
+fn_print_dots "Checking server files"
+sleep 1
+check.sh
 check_status.sh
 if [ "${status}" != "0" ]; then
 	exitbypass=1

+ 2 - 2
lgsm/functions/core_messages.sh

@@ -218,11 +218,11 @@ fn_print_failure_nl(){
 }
 
 # Error!
-fn_print_error(){
+fn_print_error2(){
 	echo -en "${red}Error!${default} $@"
 }
 
-fn_print_error_nl(){
+fn_print_error2_nl(){
 	echo -e "${red}Error!${default} $@"
 }