Move --force argument into doUpdate

This commit is contained in:
Ben Peddell 2015-09-16 18:45:19 +10:00
parent 22b021b41b
commit c329f28fee

View File

@ -448,9 +448,21 @@ doInstall() {
# Stop the server, update it and then start it back. # Stop the server, update it and then start it back.
# #
doUpdate() { doUpdate() {
local appupdate=
for arg in "$@"; do
if [ "$arg" == "--force" ]; then
appupdate=1
fi
done
cd "$arkserverroot" cd "$arkserverroot"
if isUpdateNeeded; then if isUpdateNeeded; then
appupdate=1
fi
if [ -n "$appupdate" ]; then
forceUpdate forceUpdate
else else
echo "Your server is already up to date! The most recent version is ${bnumber}." echo "Your server is already up to date! The most recent version is ${bnumber}."
@ -870,7 +882,7 @@ while true; do
;; ;;
update) update)
if [ "$2" == "--force" ]; then if [ "$2" == "--force" ]; then
forceUpdate doUpdate --force
shift shift
elif [ "$2" == "--safe" ]; then elif [ "$2" == "--safe" ]; then
doSafeUpdate doSafeUpdate