aboutsummaryrefslogtreecommitdiff
path: root/minecraft
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-03 13:22:32 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-03 13:23:10 +0100
commit49750fcdfdab1da71b308ae80fa2f803755f129f (patch)
treebb5111ac9635c3d409275df1d66005d487394b36 /minecraft
parent059366bc4458136471b7976cb5df3eba35ade536 (diff)
downloadalpine-49750fcdfdab1da71b308ae80fa2f803755f129f.tar.gz
Use ebegin, einfo, eend for conformityminecraft
Diffstat (limited to 'minecraft')
-rw-r--r--minecraft18
1 files changed, 14 insertions, 4 deletions
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
}