From e0818e7e5285f0a78bb2c46c8b9693d10020008a Mon Sep 17 00:00:00 2001 From: David Schwartz Date: Fri, 29 Jun 2018 09:48:29 -0400 Subject: [PATCH] reorganize and optimize start.sh (#2267) --- start.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/start.sh b/start.sh index fcc6dd074..ac84f829d 100755 --- a/start.sh +++ b/start.sh @@ -2,8 +2,6 @@ DIR="$(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" cd "$DIR" -DO_LOOP="no" - while getopts "p:f:l" OPTION 2> /dev/null; do case ${OPTION} in p) @@ -46,19 +44,18 @@ fi LOOPS=0 set +e -while [ "$LOOPS" -eq 0 ] || [ "$DO_LOOP" == "yes" ]; do - if [ "$DO_LOOP" == "yes" ]; then - "$PHP_BINARY" "$POCKETMINE_FILE" $@ - else - exec "$PHP_BINARY" "$POCKETMINE_FILE" $@ - fi - if [ "$DO_LOOP" == "yes" ]; then + +if [ "$DO_LOOP" == "yes" ]; then + while true; do if [ ${LOOPS} -gt 0 ]; then echo "Restarted $LOOPS times" fi + "$PHP_BINARY" "$POCKETMINE_FILE" $@ echo "To escape the loop, press CTRL+C now. Otherwise, wait 5 seconds for the server to restart." echo "" sleep 5 ((LOOPS++)) - fi -done + done +else + exec "$PHP_BINARY" "$POCKETMINE_FILE" $@ +fi