diff options
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 } |