|
@@ -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
|