mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-24 15:38:26 +00:00
add function to check if an update is needed
This commit is contained in:
parent
9a07351447
commit
b973cb1ddb
@ -19,6 +19,8 @@ source /etc/arkmanager/arkmanager.cfg
|
|||||||
# Local variables
|
# Local variables
|
||||||
info=""
|
info=""
|
||||||
thejob=""
|
thejob=""
|
||||||
|
instver=""
|
||||||
|
bnumber=""
|
||||||
timestamp=$( date +%T )
|
timestamp=$( date +%T )
|
||||||
GREEN="\\033[1;32m"
|
GREEN="\\033[1;32m"
|
||||||
RED="\\033[1;31m"
|
RED="\\033[1;31m"
|
||||||
@ -27,6 +29,22 @@ NORMAL="\\033[0;39m"
|
|||||||
#---------------------
|
#---------------------
|
||||||
# functions
|
# functions
|
||||||
#---------------------
|
#---------------------
|
||||||
|
function isUpdateNeeded(){
|
||||||
|
#
|
||||||
|
# Check if the server need to be updated
|
||||||
|
# Return 1 if update is needed, else return 0
|
||||||
|
#
|
||||||
|
getCurrentVersion
|
||||||
|
getAvailableVersion
|
||||||
|
echo $instver
|
||||||
|
echo $bnumber
|
||||||
|
if ["$bnumber" = "$instver"]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
function getCurrentVersion(){
|
function getCurrentVersion(){
|
||||||
#
|
#
|
||||||
# Return the current version number
|
# Return the current version number
|
||||||
@ -135,15 +153,7 @@ doInstall() {
|
|||||||
# update function
|
# update function
|
||||||
doUpdate() {
|
doUpdate() {
|
||||||
cd $arkserverroot
|
cd $arkserverroot
|
||||||
touch arkversion # If the file doesn't exist
|
if isUpdateNeeded; then
|
||||||
instver=`cat "arkversion"`
|
|
||||||
bnumber=`$steamcmdroot/$steamcmdexec +login anonymous +app_info_print "$appid" +quit | grep -EA 5 "^\s+\"public\"$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -f3 | sed 's/^ //' | cut -c9-14`
|
|
||||||
if ["$bnumber" = "$instver"]; then
|
|
||||||
patch=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (($patch == 1))
|
|
||||||
then
|
|
||||||
if [ -f "$arkserverroot/arkupdate.timed" ]
|
if [ -f "$arkserverroot/arkupdate.timed" ]
|
||||||
then
|
then
|
||||||
doStop
|
doStop
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user