From 49750fcdfdab1da71b308ae80fa2f803755f129f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 3 Nov 2020 13:22:32 +0100 Subject: Use ebegin, einfo, eend for conformity --- minecraft | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'minecraft') diff --git a/minecraft b/minecraft index 64c786b..3b23f49 100644 --- a/minecraft +++ b/minecraft @@ -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 } -- cgit v1.2.3