Explorar el Código

Various minor changes

Daniel Gibbs hace 9 años
padre
commit
352bd06887

+ 1 - 0
Factorio/fctrserver

@@ -102,6 +102,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}"
 backupdir="${rootdir}/backups"
 backupdir="${rootdir}/backups"
 
 
 ## Logging Directories
 ## Logging Directories
+gamelogdir="${filesdir}"
 scriptlogdir="${rootdir}/log/script"
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
 consolelogdir="${rootdir}/log/console"
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 scriptlog="${scriptlogdir}/${servicename}-script.log"

+ 3 - 3
lgsm/functions/command_details.sh

@@ -309,7 +309,7 @@ fn_details_ports(){
 	echo -e "Change ports by editing the parameters in:"
 	echo -e "Change ports by editing the parameters in:"
 
 
 	parmslocation="${red}UNKNOWN${default}"
 	parmslocation="${red}UNKNOWN${default}"
-	# engines that require editing in the config file
+	# engines/games that require editing in the config file
 	local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
 	local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
 	for port_edit in "${ports_edit_array[@]}"
 	for port_edit in "${ports_edit_array[@]}"
 	do
 	do
@@ -317,8 +317,8 @@ fn_details_ports(){
 			parmslocation="${servercfgfullpath}"
 			parmslocation="${servercfgfullpath}"
 		fi
 		fi
 	done
 	done
-	# engines that require editing in the script file
-	local ports_edit_array=( "Factorio" "goldsource" "Hurtworld" "iw3.0"  "Rust" "spark" "source" "starbound" "unreal4" )
+	# engines/games that require editing in the script file
+	local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0"  "Rust" "spark" "source" "starbound" "unreal4" )
 	for port_edit in "${ports_edit_array[@]}"
 	for port_edit in "${ports_edit_array[@]}"
 	do
 	do
 		if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
 		if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then

+ 5 - 1
lgsm/functions/install_config.sh

@@ -262,7 +262,11 @@ elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
 	fn_default_config_remote
 	fn_default_config_remote
 	fn_set_config_vars
 	fn_set_config_vars
 elif [ "${gamename}" == "Factorio" ]; then
 elif [ "${gamename}" == "Factorio" ]; then
-	:
+	gamedirname="Factorio"
+	array_configs+=( server-settings.json )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Fistful of Frags" ]; then
 elif [ "${gamename}" == "Fistful of Frags" ]; then
 	gamedirname="FistfulofFrags"
 	gamedirname="FistfulofFrags"
 	array_configs+=( server.cfg )
 	array_configs+=( server.cfg )

+ 1 - 2
lgsm/functions/install_factorio_save.sh

@@ -11,5 +11,4 @@ echo ""
 echo "Creating initial Factorio savefile"
 echo "Creating initial Factorio savefile"
 echo "================================="
 echo "================================="
 sleep 1
 sleep 1
-${filesdir}/bin/x64/factorio --create ${filesdir}/save1
-cp ${filesdir}/data/server-settings.example.json ${filesdir}/data/server-settings.json
+"${executabledir}"/factorio --create ${filesdir}/save1

+ 22 - 22
lgsm/functions/update_factorio.sh

@@ -16,7 +16,7 @@ fn_update_factorio_dl(){
 	fn_script_log "Copying to ${filesdir}"
 	fn_script_log "Copying to ${filesdir}"
 	cp -R "${tmpdir}/factorio/"* "${filesdir}"
 	cp -R "${tmpdir}/factorio/"* "${filesdir}"
 	local exitcode=$?
 	local exitcode=$?
-	if [ ${exitcode} -eq 0 ]; then
+	if [ "${exitcode}" == "0" ]; then
 		fn_print_ok_eol_nl
 		fn_print_ok_eol_nl
 	else
 	else
 		fn_print_fail_eol_nl
 		fn_print_fail_eol_nl
@@ -27,13 +27,13 @@ fn_update_factorio_currentbuild(){
 	# Gets current build info
 	# Gets current build info
 	# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
 	# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
 	if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then
 	if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then
-		fn_print_error "Checking for update: Factorio.com"
+		fn_print_error "Checking for update: factorio.com"
 		sleep 1
 		sleep 1
-		fn_print_error_nl "Checking for update: Factorio.com: No logs with server version found"
-		fn_script_log_error "Checking for update: Factorio.com: No logs with server version found"
+		fn_print_error_nl "Checking for update: factorio.com: No logs with server version found"
+		fn_script_log_error "Checking for update: factorio.com: No logs with server version found"
 		sleep 1
 		sleep 1
-		fn_print_info_nl "Checking for update: Factorio.com: Forcing server restart"
-		fn_script_log_info "Checking for update: Factorio.com: Forcing server restart"
+		fn_print_info_nl "Checking for update: factorio.com: Forcing server restart"
+		fn_script_log_info "Checking for update: factorio.com: Forcing server restart"
 		sleep 1
 		sleep 1
 		exitbypass=1
 		exitbypass=1
 		command_stop.sh
 		command_stop.sh
@@ -42,8 +42,8 @@ fn_update_factorio_currentbuild(){
 		sleep 1
 		sleep 1
 		# Check again and exit on failure.
 		# Check again and exit on failure.
 		if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then
 		if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then
-			fn_print_fail_nl "Checking for update: Factorio.com: Still No logs with server version found"
-			fn_script_log_fatal "Checking for update: Factorio.com: Still No logs with server version found"
+			fn_print_fail_nl "Checking for update: factorio.com: Still No logs with server version found"
+			fn_script_log_fatal "Checking for update: factorio.com: Still No logs with server version found"
 			core_exit.sh
 			core_exit.sh
 		fi
 		fi
 	fi
 	fi
@@ -51,19 +51,19 @@ fn_update_factorio_currentbuild(){
 	# Get current build from logs
 	# Get current build from logs
 	currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | grep -oP '(?<=Factorio ).*?(?= \()')
 	currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | grep -oP '(?<=Factorio ).*?(?= \()')
 	if [ -z "${currentbuild}" ]; then
 	if [ -z "${currentbuild}" ]; then
-		fn_print_error_nl "Checking for update: Factorio.com: Current build version not found"
-		fn_script_log_error "Checking for update: Factorio.com: Current build version not found"
+		fn_print_error_nl "Checking for update: factorio.com: Current build version not found"
+		fn_script_log_error "Checking for update: factorio.com: Current build version not found"
 		sleep 1
 		sleep 1
-		fn_print_info_nl "Checking for update: Factorio.com: Forcing server restart"
-		fn_script_log_info "Checking for update: Factorio.com: Forcing server restart"
+		fn_print_info_nl "Checking for update: factorio.com: Forcing server restart"
+		fn_script_log_info "Checking for update: factorio.com: Forcing server restart"
 		exitbypass=1
 		exitbypass=1
 		command_stop.sh
 		command_stop.sh
 		exitbypass=1
 		exitbypass=1
 		command_start.sh
 		command_start.sh
 		currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | grep -oP '(?<=Factorio ).*?(?= /)')
 		currentbuild=$(cat "${consolelogdir}"/"${servicename}"-console.log 2> /dev/null | sort | grep -oP '(?<=Factorio ).*?(?= /)')
 		if [ -z "${currentbuild}" ]; then
 		if [ -z "${currentbuild}" ]; then
-			fn_print_fail_nl "Checking for update: Factorio.com: Current build version still not found"
-			fn_script_log_fatal "Checking for update: Factorio.com: Current build version still not found"
+			fn_print_fail_nl "Checking for update: factorio.com: Current build version still not found"
+			fn_script_log_fatal "Checking for update: factorio.com: Current build version still not found"
 			core_exit.sh
 			core_exit.sh
 		fi
 		fi
 	fi
 	fi
@@ -81,14 +81,14 @@ fn_update_factorio_availablebuild(){
 
 
 	# Checks if availablebuild variable has been set
 	# Checks if availablebuild variable has been set
 	if [ -z "${availablebuild}" ]; then
 	if [ -z "${availablebuild}" ]; then
-		fn_print_fail "Checking for update: Factorio.com"
+		fn_print_fail "Checking for update: factorio.com"
 		sleep 1
 		sleep 1
-		fn_print_fail "Checking for update: Factorio.com: Not returning version info"
-		fn_script_log_fatal "Failure! Checking for update: Factorio.com: Not returning version info"
+		fn_print_fail "Checking for update: factorio.com: Not returning version info"
+		fn_script_log_fatal "Failure! Checking for update: factorio.com: Not returning version info"
 		core_exit.sh
 		core_exit.sh
 	else
 	else
-		fn_print_ok "Checking for update: Factorio.com"
-		fn_script_log_pass "Checking for update: Factorio.com"
+		fn_print_ok "Checking for update: factorio.com"
+		fn_script_log_pass "Checking for update: factorio.com"
 		sleep 1
 		sleep 1
 	fi
 	fi
 }
 }
@@ -155,9 +155,9 @@ if [ "${installer}" == "1" ]; then
 	fn_update_factorio_availablebuild
 	fn_update_factorio_availablebuild
 	fn_update_factorio_dl
 	fn_update_factorio_dl
 else
 else
-	# Checks for server update from github.com
-	fn_print_dots "Checking for update: github.com"
-	fn_script_log_info "Checking for update: github.com"
+	# Checks for server update from factorio.com
+	fn_print_dots "Checking for update: factorio.com"
+	fn_script_log_info "Checking for update: factorio.com"
 	sleep 1
 	sleep 1
 	fn_update_factorio_currentbuild
 	fn_update_factorio_currentbuild
 	fn_update_factorio_availablebuild
 	fn_update_factorio_availablebuild