Browse Source

Improving update functions

pull/914/head
Daniel Gibbs 9 years ago
parent
commit
f7121a30e0
  1. 2
      lgsm/functions/command_update.sh
  2. 38
      lgsm/functions/update_steamcmd.sh
  3. 2
      lgsm/functions/update_ts3.sh

2
lgsm/functions/command_update.sh

@ -14,3 +14,5 @@ if [ "${gamename}" == "Teamspeak 3" ]; then
elif [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then
update_steamcmd.sh
fi
core_exit.sh

38
lgsm/functions/update_steamcmd.sh

@ -6,9 +6,8 @@ lgsm_version="210516"
# Description:Handles updating using steamCMD.
fn_steamcmd_dl(){
cd "${rootdir}"
cd "steamcmd"
fn_update_steamcmd_dl(){
cd "${rootdir}/steamcmd"
# Detects if unbuffer command is available.
if [ $(command -v stdbuf) ]; then
@ -83,7 +82,7 @@ fn_appmanifest_check(){
fi
}
fn_logupdaterequest(){
fn_update_request_log(){
# Checks for server update requests from server logs.
fn_print_dots "Checking for update: Server logs"
fn_script_log "Checking for update: Server logs"
@ -104,11 +103,13 @@ fn_logupdaterequest(){
unset updateonstart
check_status.sh
if [ "${status}" != "0" ]; then
exitbypass=1
command_stop.sh
update_dl.sh
fn_update_steamcmd_dl
exitbypass=1
command_start.sh
else
update_dl.sh
fn_update_steamcmd_dl
fi
alert="update"
alert.sh
@ -118,7 +119,7 @@ fn_logupdaterequest(){
fi
}
fn_steamcmdcheck(){
fn_update_steamcmd_check(){
fn_appmanifest_check
# Checks for server update from SteamCMD
fn_print_dots "Checking for update: SteamCMD"
@ -183,11 +184,11 @@ fn_steamcmdcheck(){
if [ "${status}" != "0" ]; then
exitbypass=1
command_stop.sh
fn_steamcmd_dl
fn_update_steamcmd_dl
exitbypass=1
command_start.sh
else
fn_steamcmd_dl
fn_update_steamcmd_dl
fi
alert="update"
alert.sh
@ -205,4 +206,21 @@ fn_steamcmdcheck(){
}
fn_steamcmdcheck
if [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then
# Goldsource servers bypass checks as fn_update_steamcmd_check does not work for appid 90 servers.
# forceupdate bypasses checks
check_status.sh
if [ "${status}" != "0" ]; then
exitbypass=1
command_stop.sh
fn_update_steamcmd_dl
exitbypass=1
command_start.sh
else
fn_update_steamcmd_dl
fi
else
fn_update_request_log
fn_update_steamcmd_check
fi
core_exit.sh

2
lgsm/functions/update_ts3.sh

@ -12,7 +12,6 @@ fn_update_ts3_dl(){
}
fn_update_ts3_check(){
# Checks for server update from teamspeak.com using a mirror dl.4players.de.
fn_print_dots "Checking for update: teamspeak.com"
fn_script_log_info "Checking for update: teamspeak.com"
@ -145,4 +144,3 @@ fn_update_ts3_check(){
fn_script_log_info "Current build: ${currentbuild}"
fn_script_log_info "Available build: ${availablebuild}"
fi
}

Loading…
Cancel
Save