diff --git a/autoshutdown.sh b/autoshutdown.sh index d074476..3ff99e2 100755 --- a/autoshutdown.sh +++ b/autoshutdown.sh @@ -36,7 +36,6 @@ soft_poweroff() { echo "Time to live is $(cat "$LIVE_UNTIL")" if [ "$(date +%s)" -ge "$ttl" ]; then echo "Server empty longer than grace time, shutting down" - empty_reset # Needs to be 0 next time server starts tmux send-keys -t "$TMUX_NAME.0" "stop" ENTER sleep 5 $(sudo /sbin/shutdown -P +1) @@ -49,7 +48,7 @@ tmux_running() { } server_responsive() { - silent_exitcode mcstatus localhost ping + silent_exitcode /usr/local/bin/mcstatus localhost ping } n_logins="$(w -h | wc -l)" @@ -68,7 +67,7 @@ else fi if server_responsive; then - n_players=$(mcstatus localhost json | json_parse player_count) + n_players=$(/usr/local/bin/mcstatus localhost json | json_parse player_count) echo "Server responsive. $n_players players online" if [ "$n_players" -gt 0 ]; then # Keep alive as players are online