From 20de638b793b04152d1c76be987508fc4ea4ff59 Mon Sep 17 00:00:00 2001
From: UltimateByte <robin.labadie@gmail.com>
Date: Mon, 7 Nov 2016 19:33:50 +0100
Subject: [PATCH] hotfix for ts3 server pass

Issue: other functions were triggering core_exit.sh
Fix: bypass them
bonus: better output
Sample output:
http://hastebin.com/quxulezila.rb
---
 lgsm/functions/command_ts3_server_pass.sh | 26 ++++++++++++-----------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh
index 89c3cd036..1a9896889 100644
--- a/lgsm/functions/command_ts3_server_pass.sh
+++ b/lgsm/functions/command_ts3_server_pass.sh
@@ -29,22 +29,17 @@ fn_serveradmin_password_prompt(){
 	done
 	fn_script_log_info "Initiating ${gamename} ServerAdmin password change"
 	read -p "Enter new password : " newpassword
-	}
+}
 
 
-	fn_serveradmin_password_set(){
-	fn_print_info_nl "Applying new password"
-	fn_script_log_info "Applying new password"
+fn_serveradmin_password_set(){
+	fn_print_info_nl "Starting server with new password..."
+	fn_script_log_info "Starting server with new password"
 	sleep 1
-	# Stop any running server
-	command_stop.sh
 	# Start server in "new password mode"
 	ts3serverpass="1"
-	fn_print_info_nl "Starting server with new password"
+	exitbypass="1"
 	command_start.sh
-	# Stop server in "new password mode"
-	command_stop.sh
-	ts3serverpass="0"
 	fn_print_ok_nl "Password applied"
 	fn_script_log_pass "New ServerAdmin password applied"
 	sleep 1
@@ -55,9 +50,16 @@ check.sh
 fn_serveradmin_password_prompt
 check_status.sh
 if [ "${status}" != "0" ]; then
+	# Stop any running server
+	exitbypass="1"
+	command_stop.sh
 	fn_serveradmin_password_set
-	command_start.sh
+	ts3serverpass="0"
+	fn_print_info_nl "Restarting server normally"
+	fn_script_log_info "Restarting server normally"
+	command_restart.sh
 else
 	fn_serveradmin_password_set
+	command_stop.sh
 fi
-core_exit.sh
\ No newline at end of file
+core_exit.sh