diff --git a/tools/arkmanager b/tools/arkmanager index 067e2f9..b610fbc 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -1776,17 +1776,19 @@ doWarn(){ printWarnMessage "$1" "$2" "minutes" "$warnminutes" "$usenotify" usenotify= for (( min = warnminutes - 1; min >= warninterval; min-- )); do - numplayers=$(numPlayersConnected) - echo "There are ${numplayers} players connected" - if [[ "numplayers" == "-1" ]]; then - echo "Server is not running. Shutting down immediately" - notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}" - return 0 - elif (( (numplayers + 0) == 0 )); then - doBroadcastWithEcho "Nobody is connected. Shutting down immediately" - notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}" - rm -f "${arkserverroot}/${arkwarnlockfile}" - return 0 + if [ "$arkprecisewarn" != "true" ]; then + numplayers=$(numPlayersConnected) + echo "There are ${numplayers} players connected" + if [[ "numplayers" == "-1" ]]; then + echo "Server is not running. Shutting down immediately" + notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}" + return 0 + elif (( (numplayers + 0) == 0 )); then + doBroadcastWithEcho "Nobody is connected. Shutting down immediately" + notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}" + rm -f "${arkserverroot}/${arkwarnlockfile}" + return 0 + fi fi if isUpdateCancelRequested; then doBroadcastWithEcho "Restart cancelled by player request" @@ -1821,17 +1823,19 @@ doWarn(){ printWarnMessage "$1" "$2" "seconds" "$warnseconds" "$usenotify" usenotify= if (( warnseconds >= 20 )); then - numplayers=$(numPlayersConnected) - echo "There are ${numplayers} players connected" - if [[ "numplayers" == "-1" ]]; then - echo "Server is not running. Shutting down immediately" - notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}" - return 0 - elif (( (numplayers + 0) == 0 )); then - doBroadcastWithEcho "Nobody is connected. Shutting down immediately" - notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}" - rm -f "${arkserverroot}/${arkwarnlockfile}" - return 0 + if [ "$arkprecisewarn" != "true" ]; then + numplayers=$(numPlayersConnected) + echo "There are ${numplayers} players connected" + if [[ "numplayers" == "-1" ]]; then + echo "Server is not running. Shutting down immediately" + notify "${notifyMsgServerNotRunning:-Server is not running. Shutting down immediately}" + return 0 + elif (( (numplayers + 0) == 0 )); then + doBroadcastWithEcho "Nobody is connected. Shutting down immediately" + notify "${notifyMsgNobodyConnected:-Nobody is connected. Shutting down immediately}" + rm -f "${arkserverroot}/${arkwarnlockfile}" + return 0 + fi fi if isUpdateCancelRequested; then doBroadcastWithEcho "Restart cancelled by player request" diff --git a/tools/arkmanager.cfg b/tools/arkmanager.cfg index 1ca6766..e0bd400 100644 --- a/tools/arkmanager.cfg +++ b/tools/arkmanager.cfg @@ -16,6 +16,7 @@ steamcmd_workshoplog="/home/steam/Steam/logs/workshop_log.txt" # Steam work arkserverexec="ShooterGame/Binaries/Linux/ShooterGameServer" # name of ARK server executable arkbackupdir="/home/steam/ARK-Backups" # path to backup directory arkwarnminutes="60" # number of minutes to warn players when using update --warn +arkprecisewarn="false" # set this to true to obey warnminutes even if no players are connected (recommended for clusters) arkautorestartfile="ShooterGame/Saved/.autorestart" # path to autorestart file arkAutoUpdateOnStart="false" # set this to true if you want to always update before startup arkBackupPreUpdate="false" # set this to true if you want to perform a backup before updating