Skip to content

Instantly share code, notes, and snippets.

@kerryhatcher
Created March 31, 2021 21:57
Show Gist options
  • Save kerryhatcher/5ed7cf51d9c0f5e9d9e0c61c14f7a5cd to your computer and use it in GitHub Desktop.
Save kerryhatcher/5ed7cf51d9c0f5e9d9e0c61c14f7a5cd to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
#Based on
mcservername="cotscraft"
if [ $(id -u) -ne 0 ]
then echo "Please run as root"
exit
fi
apt update
apt install wget screen default-jdk nmap
useradd -m -r -d /opt/minecraft minecraft
mkdir /opt/minecraft/$mcservername
wget -O /opt/minecraft/$mcservername/minecraft_server.jar https://papermc.io/api/v2/projects/paper/versions/1.16.5/builds/575/downloads/paper-1.16.5-575.jar
bash -c "echo eula=true > /opt/minecraft/$mcservername/eula.txt"
wget -O /etc/systemd/system/minecraft@.service https://gist.githubusercontent.com/kerryhatcher/c3bb1555c95a652470aafddb7e286ce5/raw/db98a36746485904c45da363812d504bd050bb25/minecraft@.service
systemctl start minecraft@survival
systemctl status minecraft@survival
systemctl enable minecraft@survival
nmap -p 25565 localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment