mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-11 18:48:26 +00:00
Stop warning if server is offline
This commit is contained in:
parent
ca9ea08ebe
commit
94f3e9566d
@ -1174,7 +1174,10 @@ doWarn(){
|
||||
for (( min = warnminutes; min >= warninterval; min-- )); do
|
||||
numplayers=$(numPlayersConnected)
|
||||
echo "There are ${numplayers} players connected"
|
||||
if (( (numplayers + 0) == 0 )); then
|
||||
if [[ "numplayers" == "-1" ]]; then
|
||||
echo "Server is not running. Shutting down immediately"
|
||||
return 0
|
||||
elif (( (numplayers + 0) == 0 )); then
|
||||
doBroadcastWithEcho "Nobody is connected. Shutting down immediately"
|
||||
rm -f "${arkserverroot}/.ark-warn.lock"
|
||||
return 0
|
||||
@ -1207,7 +1210,10 @@ doWarn(){
|
||||
if (( warnseconds >= 20 )); then
|
||||
numplayers=$(numPlayersConnected)
|
||||
echo "There are ${numplayers} players connected"
|
||||
if (( (numplayers + 0) == 0 )); then
|
||||
if [[ "numplayers" == "-1" ]]; then
|
||||
echo "Server is not running. Shutting down immediately"
|
||||
return 0
|
||||
elif (( (numplayers + 0) == 0 )); then
|
||||
doBroadcastWithEcho "Nobody is connected. Shutting down immediately"
|
||||
rm -f "${arkserverroot}/.ark-warn.lock"
|
||||
return 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user