Last active
April 5, 2020 04:34
-
-
Save gotcake/cf8d2c025c0e208a454368af181d4738 to your computer and use it in GitHub Desktop.
Setup script for a mincraft server based on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O minecraft_server_setup.sh https://gist.githubusercontent.com/gotcake/cf8d2c025c0e208a454368af181d4738/raw/1077e9494c0d17e5af4a6839e04b021f598dbee8/mincraft_server_setup.sh | |
bash minecraft_server_setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
# create user | |
if [ -z "$(cut -d: -f1 /etc/passwd | grep minecraft)" ]; then | |
useradd -d /minecraft minecraft | |
usermod -aG sudo minecraft | |
fi | |
# install java | |
if [ -z "$(which java)" ]; then | |
apt install openjdk-11-jre-headless | |
fi | |
# download and install | |
mkdir -p /minecraft/build | |
rm -rf /minecraft/build/* | |
cd /minecraft/build | |
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar | |
java -jar BuildTools.jar --rev latest | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment