Skip to content

Instantly share code, notes, and snippets.

@lasseebert
Created May 16, 2020 09:30
Show Gist options
  • Save lasseebert/58ecb0e2eb73c32c572662c77f6ce4eb to your computer and use it in GitHub Desktop.
Save lasseebert/58ecb0e2eb73c32c572662c77f6ce4eb to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
echo "Installing minecraft server"
read -p "ssh to the server. Press any key to continue."
echo ""
echo "Copy and paste:"
echo "apt update"
echo "apt upgrade"
echo "apt install unzip"
echo "wget https://minecraft.azureedge.net/bin-linux/bedrock-server-1.14.60.5.zip"
echo "unzip bedrock-server-1.14.60.5.zip"
echo ""
read -p "Ok, that's done."
echo ""
echo "Edit server.properties to:"
echo "* set a nice server name"
echo "* set a nice level name"
echo "* enable white listing"
echo ""
read -p "Ok, that's done."
echo ""
echo "Edit whitelist.json with the needed users."
echo "Format:"
echo "["
echo " {"
echo ' "name": "gamertag"'
echo " }"
echo "]"
echo "UUID will be added when they first sign in"
echo ""
read -p "Ok, that's done."
echo ""
echo "Copy paste the following into /etc/systemd/system/minecraft.service"
echo ""
echo "[Unit]"
echo "Description=Minecraft bedrock server"
echo "After=network.target"
echo "StartLimitIntervalSec=0"
echo ""
echo "[Service]"
echo "WorkingDirectory=/root"
echo "Environment="LD_LIBRARY_PATH=.""
echo "Type=simple"
echo "Restart=always"
echo "RestartSec=1"
echo "User=root"
echo "ExecStart=/bin/sh -c "./bedrock_server""
echo ""
echo "[Install]"
echo "WantedBy=multi-user.target"
echo ""
read -p "Ok, that's done."
echo ""
echo "Enable and start the service:"
echo ""
echo "systemctl daemon-reload"
echo "systemctl enable minecraft"
echo "systemctl start minecraft"
echo ""
read -p "Ok, that's done."
echo ""
read -p "All done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment