Support multiple commands in a single invocation

This commit is contained in:
Ben Peddell 2015-07-20 17:02:26 +10:00
parent f58645cc1a
commit b52770f236

View File

@ -579,7 +579,8 @@ doUpgrade() {
# check the configuration and throw errors or warnings if needed # check the configuration and throw errors or warnings if needed
checkConfig checkConfig
case "$1" in while true; do
case "$1" in
start) start)
doStart doStart
;; ;;
@ -600,8 +601,10 @@ case "$1" in
update) update)
if [ "$2" == "--force" ]; then if [ "$2" == "--force" ]; then
forceUpdate forceUpdate
shift
elif [ "$2" == "--safe" ]; then elif [ "$2" == "--safe" ]; then
doSafeUpdate doSafeUpdate
shift
else else
doUpdate doUpdate
fi fi
@ -614,12 +617,14 @@ case "$1" in
;; ;;
broadcast) broadcast)
doBroadcast "$2" doBroadcast "$2"
shift
;; ;;
saveworld) saveworld)
doSaveWorld doSaveWorld
;; ;;
rconcmd) rconcmd)
rconcmd "$2" rconcmd "$2"
shift
;; ;;
status) status)
printStatus printStatus
@ -644,9 +649,16 @@ case "$1" in
echo "update --force Apply update without check the current version" echo "update --force Apply update without check the current version"
echo "update --safe Wait for server to perform world save and update." echo "update --safe Wait for server to perform world save and update."
echo "upgrade Check for a new ARK Server Tools version and upgrades it if needed" echo "upgrade Check for a new ARK Server Tools version and upgrades it if needed"
exit 1
;; ;;
*) *)
echo "arkmanager v${arkstVersion}: no command specified" echo "arkmanager v${arkstVersion}: no command specified"
echo "Try 'arkmanager -h' or 'arkmanager --help' for more information." echo "Try 'arkmanager -h' or 'arkmanager --help' for more information."
exit 1
;; ;;
esac esac
shift
if [ $# -eq 0 ]; then
break
fi
done