Fix interaction between start and update

This commit is contained in:
Ben Peddell 2016-08-29 20:44:11 +10:00
parent 97875f88aa
commit 05e8511e22

View File

@ -736,10 +736,11 @@ doRun() {
# start function # start function
# #
doStart() { doStart() {
touch "${arkserverroot}/.startAfterUpdate"
if [ -f "${arkserverroot}/.ark-update.lock" ]; then if [ -f "${arkserverroot}/.ark-update.lock" ]; then
local updatepid="$(<"${arkserverroot}/.ark-update.lock")" local updatepid="$(<"${arkserverroot}/.ark-update.lock")"
if kill -0 "$updatepid" >/dev/null 2>&1; then if kill -0 "$updatepid" >/dev/null 2>&1; then
touch "${arkserverroot}/.startAfterUpdate"
echo "An update is currently in progress. Start aborted" echo "An update is currently in progress. Start aborted"
return 1 return 1
fi fi
@ -783,7 +784,9 @@ doStartAll(){
# stop the ARK server # stop the ARK server
# #
doStop() { doStop() {
rm -f "${arkserverroot}/.startAfterUpdate" if [ "$1" != "update" ]; then
rm -f "${arkserverroot}/.startAfterUpdate"
fi
if isTheServerRunning; then if isTheServerRunning; then
if [[ " $* " =~ " --warn " ]]; then if [[ " $* " =~ " --warn " ]]; then
@ -1116,7 +1119,7 @@ doUpdate() {
doSaveWorld doSaveWorld
fi fi
doStop doStop update
# If user wants to back-up, we do it here. # If user wants to back-up, we do it here.