diff options
author | John Ankarström <john@ankarstrom.se> | 2020-11-03 13:22:32 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-11-03 13:23:10 +0100 |
commit | 49750fcdfdab1da71b308ae80fa2f803755f129f (patch) | |
tree | bb5111ac9635c3d409275df1d66005d487394b36 /minecraft | |
parent | 059366bc4458136471b7976cb5df3eba35ade536 (diff) | |
download | alpine-49750fcdfdab1da71b308ae80fa2f803755f129f.tar.gz |
Use ebegin, einfo, eend for conformityminecraft
Diffstat (limited to 'minecraft')
-rw-r--r-- | minecraft | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -15,11 +15,20 @@ depend() { start() { if which shiftdown > /dev/null && shiftdown then - echo Not starting Minecraft server because Shift is held. + eerror Not starting Minecraft server because Shift is held. + eend 1 return 1 else - echo Starting Minecraft server... + ebegin Starting Minecraft server (cd $MCPATH && screen -h 1024 -dmS $SESSION $CMD) + if pgrep -f "$JAR" > /dev/null + then + eend 0 + return 0 + else + eend 1 + return 1 + fi fi } @@ -27,11 +36,12 @@ stop() { if pgrep -f "$JAR" > /dev/null then screen -p 0 -S $SESSION -X eval 'stuff "stop"\015' - echo Waiting for Minecraft server to shut down... + ebegin Waiting for Minecraft server to shut down while pgrep -f "$JAR" > /dev/null do sleep 0.2 done fi - echo Minecraft server is shut down. + einfo Minecraft server is shut down. + eend 0 } |