Add --no-background option to start command

This commit is contained in:
Ben Peddell 2017-05-11 19:36:19 +10:00 committed by GitHub
parent 88b9807971
commit 1515156a12

View File

@ -1150,11 +1150,21 @@ doStart() {
if [[ " $* " =~ " --alwaysrestart " ]]; then
arkAlwaysRestartOnCrash=true
fi
nobackground=
if [[ " $* " =~ " --no-background " ]]; then
nobackground=1
fi
tput sc
logprint "The server is starting..."
local pid=$!
if [[ -n "$arkPriorityBoost" || -n "$arkCpuAffinity" ]]; then
if [[ -n "$nobackground" ]]; then
echo
doRun "$@"
return
elif [[ -n "$arkPriorityBoost" || -n "$arkCpuAffinity" ]]; then
doRun --wait </dev/null > >(while read -r l; do printf "%s: [%s] %s\n" "$(timestamp)" "${instance}" "${l}" >>"$logdir/$arkserverLog"; done) 2>&1 & # output of this command is logged
local pid="$!"