aboutsummarylogtreecommitdiffstats
path: root/minecraftd.sh
diff options
context:
space:
mode:
authorGordian Edenhofer2016-04-03 18:00:41 +0200
committerGordian Edenhofer2016-04-03 18:00:41 +0200
commite41789c522279527ce0aaf8be32cce646c3d7388 (patch)
tree35dea49c70a51fdcd655049d3a9cd44d6077149a /minecraftd.sh
parent0a4c078d7548b022203bbd9d3f24c8f1f05e0387 (diff)
downloadaur-e41789c522279527ce0aaf8be32cce646c3d7388.tar.gz
Upgpkg: 1.9.2-4
Reset no_player timer after the server has been shut down.
Diffstat (limited to 'minecraftd.sh')
-rwxr-xr-xminecraftd.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/minecraftd.sh b/minecraftd.sh
index a53bcdea5721..abf35ea6b029 100755
--- a/minecraftd.sh
+++ b/minecraftd.sh
@@ -100,7 +100,9 @@ idle_server_daemon() {
[[ $i -eq 100 ]] && echo -e "An \e[39;1merror\e[0m occurred while trying to reset the idle_server!"
sleep 0.1
done
- # Listen on port ${GAME_PORT} for incoming connections
+ # Reset timer
+ no_player=0
+ # Game server is down, listen on port ${GAME_PORT} for incoming connections
echo "Netcat is listening on port ${GAME_PORT} for incoming connections..."
${NETCAT_CMD} -v -l -p ${GAME_PORT}
[[ $? -eq 0 ]] && echo "Netcat caught an connection. The server is coming up again..."
@@ -110,10 +112,12 @@ idle_server_daemon() {
no_player=0
fi
else
+ # Reset timer
+ no_player=0
# Game server is down, listen on port ${GAME_PORT} for incoming connections
echo "Netcat is listening on port ${GAME_PORT} for incoming connections..."
${NETCAT_CMD} -v -l -p ${GAME_PORT}
- echo "Netcat caught an connection. The server is coming up again..."
+ [[ $? -eq 0 ]] && echo "Netcat caught an connection. The server is coming up again..."
IDLE_SERVER="false" ${myname} start
fi
done