Fix loop counter and add delay between restarts

This commit is contained in:
Dylan K. Taylor 2017-01-09 12:39:35 -05:00
parent 2d3b8845fd
commit 3b82a5fddf

View File

@ -53,9 +53,13 @@ while [ "$LOOPS" -eq 0 ] || [ "$DO_LOOP" == "yes" ]; do
else
exec "$PHP_BINARY" "$POCKETMINE_FILE" $@
fi
((LOOPS++))
if [ "$DO_LOOP" == "yes" ]; then
if [ ${LOOPS} -gt 0 ]; then
echo "Restarted $LOOPS times"
fi
echo "To escape the loop, press CTRL+C now. Otherwise, wait 5 seconds for the server to restart."
echo ""
sleep 5
((LOOPS++))
fi
done
if [ ${LOOPS} -gt 1 ]; then
echo "Restarted $LOOPS times"
fi