mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-28 01:08:27 +00:00
Wait for server to stop
This commit is contained in:
parent
3759904f12
commit
ac41f14700
@ -334,13 +334,27 @@ doStop() {
|
|||||||
if isTheServerRunning; then
|
if isTheServerRunning; then
|
||||||
tput sc
|
tput sc
|
||||||
echo "Stopping server..."
|
echo "Stopping server..."
|
||||||
|
echo "`timestamp`: stopping" >> "$logdir/$arkmanagerLog"
|
||||||
# kill the server with the PID
|
# kill the server with the PID
|
||||||
PID=`getServerPID`
|
PID=`getServerPID`
|
||||||
kill -INT $PID
|
kill -INT $PID
|
||||||
|
|
||||||
|
for (( i = 0; i < 10; i++ )); do
|
||||||
|
sleep 1
|
||||||
|
if ! isTheServerRunning; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if isTheServerRunning; then
|
||||||
|
tput rc
|
||||||
|
echo "Killing server..."
|
||||||
|
kill -KILL $PID
|
||||||
|
fi
|
||||||
|
|
||||||
tput rc; tput ed;
|
tput rc; tput ed;
|
||||||
echo "The server has been stopped"
|
echo "The server has been stopped"
|
||||||
echo "`timestamp`: stop" >> "$logdir/$arkmanagerLog"
|
echo "`timestamp`: stopped" >> "$logdir/$arkmanagerLog"
|
||||||
else
|
else
|
||||||
echo "The server is already stopped"
|
echo "The server is already stopped"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user