Set server.properties from environment variables
Allow for server version upgrades
This commit is contained in:
1 parent
2fd816f7a8
commit
8480be99f6
4 files changed
+137
-15
No files matched your search
+20
-11
@@ -10,16 +10,16 @@ fi
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -f bedrock_server ]; then
|
||||
case ${VERSION} in
|
||||
1.11)
|
||||
VERSION=1.11.4.2
|
||||
;;
|
||||
1.12)
|
||||
VERSION=1.12.0.28
|
||||
;;
|
||||
esac
|
||||
|
||||
case ${VERSION} in
|
||||
1.11)
|
||||
VERSION=1.11.4.2
|
||||
;;
|
||||
1.12)
|
||||
VERSION=1.12.0.28
|
||||
;;
|
||||
esac
|
||||
if [ ! -f bedrock_server-${VERSION} ]; then
|
||||
|
||||
DOWNLOAD_URL=https://minecraft.azureedge.net/bin-linux/bedrock-server-${VERSION}.zip
|
||||
|
||||
@@ -27,11 +27,20 @@ if [ ! -f bedrock_server ]; then
|
||||
|
||||
echo "Downloading Bedrock server ${VERSION} ..."
|
||||
curl -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL}
|
||||
unzip -q ${TMP_ZIP}
|
||||
|
||||
# remove only binaries to allow for an upgrade of those
|
||||
rm -f bedrock_server *.so 2> /dev/null
|
||||
# ... use -n to avoid overwriting any existing files with the archive's copy
|
||||
unzip -n -q ${TMP_ZIP}
|
||||
rm ${TMP_ZIP}
|
||||
|
||||
chmod +x bedrock_server
|
||||
mv bedrock_server bedrock_server-${VERSION}
|
||||
fi
|
||||
|
||||
set-property --file server.properties --bulk /etc/bds-property-definitions.json
|
||||
|
||||
export LD_LIBRARY_PATH=.
|
||||
|
||||
echo "Starting Bedrock server..."
|
||||
exec ./bedrock_server
|
||||
exec ./bedrock_server-${VERSION}
|
||||
Reference in new issue
Block a user