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

Merge branch 'hotfix/171216.1'

Daniel Gibbs 8 лет назад
Родитель
Сommit
989014a935

+ 1 - 1
lgsm/functions/command_console.sh

@@ -30,7 +30,7 @@ if [ "${status}" != "0" ]; then
 	fn_print_ok_nl "Accessing console"
 	fn_script_log_pass "Console accessed"
 	sleep 1
-	tmux attach-session -t "=${servicename}"
+	tmux attach-session -t ${servicename}
 	fn_print_ok_nl "Closing console"
 	fn_script_log_pass "Console closed"
 else

+ 2 - 2
lgsm/functions/command_start.sh

@@ -110,7 +110,7 @@ fn_start_tmux(){
 		fn_script_log "Tmux version: master (user compiled)"
 		echo "Tmux version: master (user compiled)" >> "${consolelog}"
 		if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
-			tmux pipe-pane -o -t "=${servicename}" "exec cat >> '${consolelog}'"
+			tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
 		fi
 	elif [ -n "${tmuxversion}" ]; then
 		# Get the digit version of tmux
@@ -128,7 +128,7 @@ fn_start_tmux(){
 			Currently installed: $(tmux -V)" > "${consolelog}"
 		# Console logging enable or not set
 		elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
-			tmux pipe-pane -o -t "=${servicename}" "exec cat >> '${consolelog}'"
+			tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
 		fi
 	else
 		echo "Unable to detect tmux version" >> "${consolelog}"

+ 4 - 4
lgsm/functions/command_stop.sh

@@ -14,7 +14,7 @@ fn_stop_graceful_ctrlc(){
 	fn_print_dots "Graceful: CTRL+c"
 	fn_script_log_info "Graceful: CTRL+c"
 	# sends quit
-	tmux send-keys C-c -t "=${servicename}" > /dev/null 2>&1
+	tmux send-keys C-c -t "${servicename}" > /dev/null 2>&1
 	# waits up to 30 seconds giving the server time to shutdown gracefuly
 	for seconds in {1..30}; do
 		check_status.sh
@@ -44,7 +44,7 @@ fn_stop_graceful_cmd(){
 	fn_print_dots "Graceful: sending \"${1}\""
 	fn_script_log_info "Graceful: sending \"${1}\""
 	# sends specific stop command
-	tmux send -t "=${servicename}" ${1} ENTER > /dev/null 2>&1
+	tmux send -t "${servicename}" ${1} ENTER > /dev/null 2>&1
 	# waits up to given seconds giving the server time to shutdown gracefully
 	for ((seconds=1; seconds<=${2}; seconds++)); do
 		check_status.sh
@@ -75,7 +75,7 @@ fn_stop_graceful_goldsource(){
 	fn_print_dots "Graceful: sending \"quit\""
 	fn_script_log_info "Graceful: sending \"quit\""
 	# sends quit
-	tmux send -t "=${servicename}" quit ENTER > /dev/null 2>&1
+	tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
 	# waits 3 seconds as goldsource servers restart with the quit command
 	for seconds in {1..3}; do
 		sleep 1
@@ -263,7 +263,7 @@ fn_stop_tmux(){
 	fn_script_log_info "tmux kill-session: ${servername}"
 	sleep 0.5
 	# Kill tmux session
-	tmux kill-session -t "=${servicename}" > /dev/null 2>&1
+	tmux kill-session -t "${servicename}" > /dev/null 2>&1
 	sleep 0.5
 	check_status.sh
 	if [ "${status}" == "0" ]; then

+ 9 - 9
lgsm/functions/update_factorio.sh

@@ -76,7 +76,7 @@ fn_update_factorio_arch(){
 
 fn_update_factorio_availablebuild(){
 	# Gets latest build info.
-	if [ "${branch}" ]; then
+	if [ "${branch}" != "stable" ]; then
 		availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless/"${branch}" | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
 	else
 		availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
@@ -108,8 +108,8 @@ fn_update_factorio_compare(){
 		echo -e "\n"
 		echo -e "Update available:"
 		sleep 1
-		echo -e "	Current build: ${red}${currentbuild} ${factorioarch}${default}"
-		echo -e "	Available build: ${green}${availablebuild} ${factorioarch}${default}"
+		echo -e "	Current build: ${red}${currentbuild} ${factorioarch} ${branch} ${default}"
+		echo -e "	Available build: ${green}${availablebuild} ${factorioarch} ${branch}${default}"
 		echo -e ""
 		sleep 1
 		echo ""
@@ -121,8 +121,8 @@ fn_update_factorio_compare(){
 		sleep 1
 		echo -en "\n"
 		fn_script_log "Update available"
-		fn_script_log "Current build: ${currentbuild}"
-		fn_script_log "Available build: ${availablebuild}"
+		fn_script_log "Current build: ${currentbuild} ${factorioarch}${branch}"
+		fn_script_log "Available build: ${availablebuild} ${factorioarch}${branch}"
 		fn_script_log "${currentbuild} > ${availablebuild}"
 
 		unset updateonstart
@@ -146,12 +146,12 @@ fn_update_factorio_compare(){
 	else
 		echo -e "\n"
 		echo -e "No update available:"
-		echo -e "	Current version: ${green}${currentbuild}${default}"
-		echo -e "	Available version: ${green}${availablebuild}${default}"
+		echo -e "	Current build: ${green}${currentbuild} ${factorioarch} ${branch}${default}"
+		echo -e "	Available build: ${green}${availablebuild} ${factorioarch} ${branch}${default}"
 		echo -e ""
 		fn_print_ok_nl "No update available"
-		fn_script_log_info "Current build: ${currentbuild}"
-		fn_script_log_info "Available build: ${availablebuild}"
+		fn_script_log_info "Current build: ${currentbuild} ${factorioarch} ${branch}"
+		fn_script_log_info "Available build: ${availablebuild} ${factorioarch} ${branch}"
 	fi
 }