|
|
@@ -4,9 +4,7 @@
|
|
|
# Website: https://linuxgsm.com
|
|
|
# Description: Handles updating of jk2 servers.
|
|
|
|
|
|
-local commandname="UPDATE"
|
|
|
-local commandaction="Update"
|
|
|
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
|
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
|
|
|
|
fn_update_jk2_dl(){
|
|
|
fn_fetch_file "https://github.com/mvdevs/jk2mv/releases/download/${remotebuild}/jk2mv-v${remotebuild}-dedicated.zip" "" "" "" "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "" "norun" "noforce" "nomd5"
|
|
|
@@ -30,6 +28,7 @@ fn_update_jk2_localbuild(){
|
|
|
fn_print_dots "Checking local build: ${remotelocation}"
|
|
|
# Uses log file to gather info.
|
|
|
# Log is generated and cleared on startup but filled on shutdown.
|
|
|
+ requirerestart=1
|
|
|
localbuild=$(grep "\"version\"" "${consolelogdir}"/* 2>/dev/null | sed 's/.*://' | awk '{print $1}' | head -n 1)
|
|
|
if [ -z "${localbuild}" ]; then
|
|
|
fn_print_error "Checking local build: ${remotelocation}"
|
|
|
@@ -118,11 +117,14 @@ fn_update_jk2_compare(){
|
|
|
if [ "${status}" == "0" ]; then
|
|
|
exitbypass=1
|
|
|
fn_update_jk2_dl
|
|
|
- exitbypass=1
|
|
|
- command_start.sh
|
|
|
- exitbypass=1
|
|
|
- command_stop.sh
|
|
|
- fn_firstcommand_reset
|
|
|
+ if [ "${requirerestart}" == "1" ]; then
|
|
|
+ exitbypass=1
|
|
|
+ command_start.sh
|
|
|
+ fn_firstcommand_reset
|
|
|
+ exitbypass=1
|
|
|
+ command_stop.sh
|
|
|
+ fn_firstcommand_reset
|
|
|
+ fi
|
|
|
# If server started.
|
|
|
else
|
|
|
fn_print_restart_warning
|