Conversation
-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
|
@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 |
|
@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. 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. |
|
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. |
No description provided.