فهرست منبع

console will attempt access after starting

Daniel Gibbs 10 سال پیش
والد
کامیت
d04fd54ea5
1فایلهای تغییر یافته به همراه10 افزوده شده و 5 حذف شده
  1. 10 5
      lgsm/functions/command_console.sh

+ 10 - 5
lgsm/functions/command_console.sh

@@ -9,6 +9,13 @@ lgsm_version="210516"
 local modulename="Console"
 local modulename="Console"
 function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 
+fn_console_access(){
+	fn_print_ok_nl "Starting"
+	fn_script_log_info "Accessed"
+	sleep 1
+	tmux attach-session -t ${servicename}
+}
+
 check.sh
 check.sh
 echo ""
 echo ""
 echo "${gamename} Console"
 echo "${gamename} Console"
@@ -29,10 +36,7 @@ fn_print_dots "Starting"
 sleep 1
 sleep 1
 check_status.sh
 check_status.sh
 if [ "${status}" != "0" ]; then
 if [ "${status}" != "0" ]; then
-	fn_print_ok_nl "Starting"
-	fn_script_log_info "Accessed"
-	sleep 1
-	tmux attach-session -t ${servicename}
+	fn_console_access
 else
 else
 	fn_print_fail_nl "Server not running"
 	fn_print_fail_nl "Server not running"
 	fn_script_log_error "Failed to access: Server not running"
 	fn_script_log_error "Failed to access: Server not running"
@@ -40,10 +44,11 @@ else
 	while true; do
 	while true; do
 		read -p "Do you want to start the server? [y/N]" yn
 		read -p "Do you want to start the server? [y/N]" yn
 		case $yn in
 		case $yn in
-		[Yy]* ) command_start.sh; break;;
+		[Yy]* ) exitbypass=1; command_start.sh; break;;
 		[Nn]* ) break;;
 		[Nn]* ) break;;
 		* ) echo "Please answer yes or no.";;
 		* ) echo "Please answer yes or no.";;
 	esac
 	esac
 	done
 	done
+	fn_console_access
 fi
 fi
 core_exit.sh
 core_exit.sh