Browse Source

fix(update): fix update on start not working (#2901)

* add space to grep to get accurate session name
* move messages to get proper output
Daniel Gibbs 6 years ago
parent
commit
04bb8485b8

+ 5 - 2
lgsm/functions/command_start.sh

@@ -165,13 +165,12 @@ fn_start_tmux(){
 	echo -en "\n"
 	echo -en "\n"
 }
 }
 
 
-
 check.sh
 check.sh
 
 
-fn_print_dots "${servername}"
 # Is the server already started.
 # Is the server already started.
 # $status comes from check_status.sh, which is run by check.sh for this command
 # $status comes from check_status.sh, which is run by check.sh for this command
 if [ "${status}" != "0" ]; then
 if [ "${status}" != "0" ]; then
+	fn_print_dots "${servername}"
 	fn_print_info_nl "${servername} is already running"
 	fn_print_info_nl "${servername} is already running"
 	fn_script_log_error "${servername} is already running"
 	fn_script_log_error "${servername} is already running"
 	if [ -z "${exitbypass}" ]; then
 	if [ -z "${exitbypass}" ]; then
@@ -189,8 +188,12 @@ if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateon
 	exitbypass=1
 	exitbypass=1
 	unset updateonstart
 	unset updateonstart
 	command_update.sh
 	command_update.sh
+	commandname="START"
+	commandaction="Starting"
 fi
 fi
 
 
+fn_print_dots "${servername}"
+
 if [ "${shortname}" == "ts3" ]; then
 if [ "${shortname}" == "ts3" ]; then
 	fn_start_teamspeak3
 	fn_start_teamspeak3
 else
 else

+ 1 - 1
lgsm/functions/info_distro.sh

@@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
 ### Game Server pid
 ### Game Server pid
 if [ "${status}" == "1" ]; then
 if [ "${status}" == "1" ]; then
-	gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}"| grep "^${sessionname}"|awk '{print $2}')
+	gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $2}')
 fi
 fi
 ### Distro information
 ### Distro information
 
 

+ 0 - 4
lgsm/functions/update_factorio.sh

@@ -170,7 +170,3 @@ else
 	fn_update_factorio_remotebuild
 	fn_update_factorio_remotebuild
 	fn_update_factorio_compare
 	fn_update_factorio_compare
 fi
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_minecraft.sh

@@ -218,7 +218,3 @@ else
 	fn_update_minecraft_remotebuild
 	fn_update_minecraft_remotebuild
 	fn_update_minecraft_compare
 	fn_update_minecraft_compare
 fi
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_minecraft_bedrock.sh

@@ -178,7 +178,3 @@ else
 	fn_update_minecraft_remotebuild
 	fn_update_minecraft_remotebuild
 	fn_update_minecraft_compare
 	fn_update_minecraft_compare
 fi
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_mta.sh

@@ -209,7 +209,3 @@ else
 	fn_update_mta_remotebuild
 	fn_update_mta_remotebuild
 	fn_update_mta_compare
 	fn_update_mta_compare
 fi
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi

+ 0 - 4
lgsm/functions/update_mumble.sh

@@ -148,7 +148,3 @@ else
 	fn_update_mumble_remotebuild
 	fn_update_mumble_remotebuild
 	fn_update_mumble_compare
 	fn_update_mumble_compare
 fi
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_steamcmd.sh

@@ -246,7 +246,3 @@ else
 	fn_update_steamcmd_remotebuild
 	fn_update_steamcmd_remotebuild
 	fn_update_steamcmd_compare
 	fn_update_steamcmd_compare
 fi
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_ts3.sh

@@ -219,7 +219,3 @@ else
 	fn_update_ts3_remotebuild
 	fn_update_ts3_remotebuild
 	fn_update_ts3_compare
 	fn_update_ts3_compare
 fi
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi