mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2025-07-01 01:29:43 -04:00
22 lines
758 B
Bash
22 lines
758 B
Bash
#!/bin/sh
|
|
|
|
RCON_PASSWORD="$(openssl rand -hex 20)"
|
|
[ ! -f /root/.rcon-cli.yaml ] && echo "password: $RCON_PASSWORD" > /root/.rcon-cli.yaml
|
|
|
|
[ ! -f eula.txt ] && echo "eula=true" > eula.txt
|
|
|
|
if [ ! -f server.properties ]; then
|
|
echo "enable-rcon=true" >> server.properties
|
|
echo "rcon.password=$RCON_PASSWORD" >> server.properties
|
|
echo "level-name=slot-1" >> server.properties
|
|
fi
|
|
|
|
# Download latest server.jar
|
|
if [ ! -f .no-update ]; then
|
|
VERSION_URL=$(curl https://piston-meta.mojang.com/mc/game/version_manifest_v2.json | jq -r '.latest.release as $latest | .versions | to_entries[] | select(.value.id == $latest) | .value.url')
|
|
SERVER_URL=$(curl $VERSION_URL | jq -r .downloads.server.url)
|
|
|
|
wget -O server.jar $SERVER_URL
|
|
fi
|
|
|
|
java -jar server.jar |