Created
March 31, 2021 21:57
-
-
Save kerryhatcher/5ed7cf51d9c0f5e9d9e0c61c14f7a5cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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/[email protected] https://gist.githubusercontent.com/kerryhatcher/c3bb1555c95a652470aafddb7e286ce5/raw/db98a36746485904c45da363812d504bd050bb25/[email protected] | |
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