mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
reorganize and optimize start.sh (#2267)
This commit is contained in:
parent
d49a41f788
commit
3846ee3d1d
19
start.sh
19
start.sh
@ -2,8 +2,6 @@
|
|||||||
DIR="$(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
|
DIR="$(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
|
||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
DO_LOOP="no"
|
|
||||||
|
|
||||||
while getopts "p:f:l" OPTION 2> /dev/null; do
|
while getopts "p:f:l" OPTION 2> /dev/null; do
|
||||||
case ${OPTION} in
|
case ${OPTION} in
|
||||||
p)
|
p)
|
||||||
@ -47,19 +45,18 @@ fi
|
|||||||
LOOPS=0
|
LOOPS=0
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
while [ "$LOOPS" -eq 0 ] || [ "$DO_LOOP" == "yes" ]; do
|
|
||||||
if [ "$DO_LOOP" == "yes" ]; then
|
if [ "$DO_LOOP" == "yes" ]; then
|
||||||
"$PHP_BINARY" "$POCKETMINE_FILE" $@
|
while true; do
|
||||||
else
|
|
||||||
exec "$PHP_BINARY" "$POCKETMINE_FILE" $@
|
|
||||||
fi
|
|
||||||
if [ "$DO_LOOP" == "yes" ]; then
|
|
||||||
if [ ${LOOPS} -gt 0 ]; then
|
if [ ${LOOPS} -gt 0 ]; then
|
||||||
echo "Restarted $LOOPS times"
|
echo "Restarted $LOOPS times"
|
||||||
fi
|
fi
|
||||||
|
"$PHP_BINARY" "$POCKETMINE_FILE" $@
|
||||||
echo "To escape the loop, press CTRL+C now. Otherwise, wait 5 seconds for the server to restart."
|
echo "To escape the loop, press CTRL+C now. Otherwise, wait 5 seconds for the server to restart."
|
||||||
echo ""
|
echo ""
|
||||||
sleep 5
|
sleep 5
|
||||||
((LOOPS++))
|
((LOOPS++))
|
||||||
fi
|
done
|
||||||
done
|
else
|
||||||
|
exec "$PHP_BINARY" "$POCKETMINE_FILE" $@
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user