Skip to content

Hotfix/190217.1#2215

Merged
dgibbs64 merged 4 commits intomasterfrom
hotfix/190217.1
Mar 1, 2019
Merged

Hotfix/190217.1#2215
dgibbs64 merged 4 commits intomasterfrom
hotfix/190217.1

Conversation

@dgibbs64
Copy link
Copy Markdown
Member

@dgibbs64 dgibbs64 commented Mar 1, 2019

No description provided.

WatskeBart and others added 4 commits February 28, 2019 16:07
-hostname="${servername}" should be -hostname='${servername}'
When applying the wrong quotes, spaces are not detected and the server name will be cut off after the first space and showing incorrectly in the server browser.
general tidy up and optimise of code
@ghost ghost assigned dgibbs64 Mar 1, 2019
@ghost ghost added the status: triage label Mar 1, 2019
@conventional-release-bot
Copy link
Copy Markdown

conventional-release-bot Bot commented Mar 1, 2019

190217.1

🐛 Bug Fixes

  • fctrserver: resolve factorio update bug (a98b5fd) by Jonathan Rosewood
  • fctrserver: refactor update_factorio.sh (cdf0d4e) by Daniel Gibbs
  • inssserver: correct hostname parameter (8ebcc1b) by WatskeBart

190217...190217.1

@dgibbs64 dgibbs64 merged commit 8ebcc1b into master Mar 1, 2019
@ghost ghost removed the status: triage label Mar 1, 2019
@delete-merged-branch delete-merged-branch Bot deleted the hotfix/190217.1 branch March 1, 2019 23:43
@dgibbs64
Copy link
Copy Markdown
Member Author

dgibbs64 commented Mar 5, 2019

@alientim please can an issue be raised for this or I will probably forget. If possible also create a PR and I can merge, this will speed up getting your fix added

@alientim
Copy link
Copy Markdown

alientim commented Mar 5, 2019

@dgibbs64 dont know how to to a PR but here is my simple fix for this.

The error i talked about it an migrations error.
If you dont clear the tmpdir you will alway CP the migrations from older versions.
Older servers hat there files from 0.12.0 this ends into startup errors.
To Fix this issues you can simply add an "tmpdir clear" to the update_factorio.sh
for me this works.

I addes this function to the file:

fn_update_factorio_clear_tmp(){
	echo -e "Clear tmpdir...\c"
	fn_script_log "Directory ${tmpdir} cleared"
	rm -r ${tmpdir}/*
	local exitcode=$?
	if [ "${exitcode}" == "0" ]; then
		fn_print_ok_eol_nl
	else
		fn_print_fail_eol_nl
	fi
}

And made changes to fn_update_factorio_compare

fn_update_factorio_compare(){
	# Removes dots so if statement can compare version numbers.
	currentbuilddigit=$(echo "${currentbuild}" | tr -cd '[:digit:]')
	availablebuilddigit=$(echo "${availablebuild}" | tr -cd '[:digit:]')

	if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then
		echo -e "\n"
		echo -e "Update available:"
		sleep 0.5
		echo -e "	Current build: ${red}${currentbuild} ${factorioarch} ${branch} ${default}"
		echo -e "	Available build: ${green}${availablebuild} ${factorioarch} ${branch}${default}"
		echo -e ""
		sleep 0.5
		echo -en "Applying update.\r"
		sleep 1
		echo -en "Applying update..\r"
		sleep 1
		echo -en "Applying update...\r"
		sleep 1
		echo -en "\n"
		fn_script_log "Update available"
		fn_script_log "Current build: ${currentbuild} ${factorioarch}${branch}"
		fn_script_log "Available build: ${availablebuild} ${factorioarch}${branch}"
		fn_script_log "${currentbuild} > ${availablebuild}"

		unset updateonstart

		check_status.sh
		if [ "${status}" == "0" ]; then
			fn_update_factorio_clear_tmp
			exitbypass=1
			fn_update_factorio_dl
			exitbypass=1
			command_start.sh
			exitbypass=1
			command_stop.sh
		else
			exitbypass=1
			command_stop.sh
			exitbypass=1
			fn_update_factorio_clear_tmp
			exitbypass=1
			fn_update_factorio_dl
			exitbypass=1
			command_start.sh
		fi
		sleep 2
		alert="update"
		alert.sh
	else
		echo -e "\n"
		echo -e "No update available:"
		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} ${factorioarch} ${branch}"
		fn_script_log_info "Available build: ${availablebuild} ${factorioarch} ${branch}"
	fi
}

The result ist, that the script clears the tmpdir before update the game.

@lock
Copy link
Copy Markdown

lock Bot commented Mar 10, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants