Add checkmodupdate command

This commit is contained in:
Ben Peddell 2017-06-19 17:34:39 +10:00
parent 23a58e953d
commit 586a688a0c
2 changed files with 26 additions and 0 deletions

View File

@ -274,6 +274,9 @@ instances.
`checkupdate`::
Checks if an ARK server update is available
`checkmodupdate`::
Checks if any mods need updating on the server
`installmods`::
Installs all mods specified in the instance config into the
`ShooterGame/Content/Mods` directory

View File

@ -1924,6 +1924,26 @@ doUpdate() {
fi
}
#
# Check if any mod update is available
#
checkForModUpdate(){
local updateavail=
for modid in $(getModIds); do
if isModUpdateAvailable $modid || isModUpdateNeeded $modid; then
printf "Mod %d [%s] update needed\n" "$modid" "$(getModName $modid)"
updateavail=1
fi
done
if [ -n "$updateavail" ]; then
return 0
else
return 1
fi
}
#
# Get the Mod IDs of the installed mods and the requested mods
#
@ -3102,6 +3122,9 @@ main(){
checkupdate)
checkForUpdate
;;
checkmodupdate)
checkForModUpdate
;;
installmod)
doInstallMod "${args[@]}"
;;