diff options
author | John Ankarström <john@ankarstrom.se> | 2020-10-30 01:08:58 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-10-30 01:21:40 +0100 |
commit | 82cd74732d64819d32ba05fc69e16bcbd9462166 (patch) | |
tree | c86e8fff6ccb5ee957330f7b3a74a292f3389106 | |
parent | d622b9c0c27f7359cda5aa83fa1b7816bf7981a2 (diff) | |
download | alpine-82cd74732d64819d32ba05fc69e16bcbd9462166.tar.gz |
Update Minecraft config
-rw-r--r-- | minecraft/install | 13 | ||||
-rw-r--r-- | minecraft/minecraft | 19 |
2 files changed, 21 insertions, 11 deletions
diff --git a/minecraft/install b/minecraft/install index 7d58d11..07e9c94 100644 --- a/minecraft/install +++ b/minecraft/install @@ -1,5 +1,14 @@ #!/bin/sh +# install the latest build of Paper for Minecraft VERSION into MCPATH + VERSION=1.16.3 -build=`curl +s https://papermc.io/api/v1/paper/$VERSION | sed 's/.*"latest":"\([0-9]*\)".*/\1/'` -curl -o paper.server.jar https://papermc.io/api/v1/paper/$VERSION/$build/download
\ No newline at end of file +MCPATH=/srv/minecraft + +apk add openjdk8-jre ncurses +apk add screen # needed only if you use the OpenRC script + +mkdir -p "$MCPATH" +cd "$MCPATH" +build=`curl -s "https://papermc.io/api/v1/paper/$VERSION" | sed 's/.*"latest":"\([0-9]*\)".*/\1/'` +curl -o paper.server.jar "https://papermc.io/api/v1/paper/$VERSION/$build/download"
\ No newline at end of file diff --git a/minecraft/minecraft b/minecraft/minecraft index 2bec0d7..33e31dc 100644 --- a/minecraft/minecraft +++ b/minecraft/minecraft @@ -1,9 +1,16 @@ -#!/bin/sh +#!/sbin/openrc-run + +name=minecraft +description='Minecraft server' MCPATH=/srv/minecraft -SESSION=minecraft -JAR=paper.server.jar +JAR=$MCPATH/paper.server.jar CMD="java -Xmx1G -Xms1G -jar $JAR nogui" +SESSION=minecraft + +depend() { + use net +} start() { echo Starting Minecraft server... @@ -22,9 +29,3 @@ stop() { fi echo Minecraft server is shut down. } - -case "$1" in - start) start;; - stop) stop;; -# *) echo "Usage: $0 start|stop" 1>&2; exit 2;; -esac |