Initial fork commit

This commit is contained in:
2020-12-28 12:27:18 -06:00
commit 0b55c1a9c7
6 changed files with 195 additions and 0 deletions

2
templates/eula.txt Normal file
View File

@@ -0,0 +1,2 @@
# Tacos best food yadda yadda
eula=true

View File

@@ -0,0 +1,15 @@
#! /bin/sh
# Find out where our modpack lives
#
# This assumes that we have no directories adjacent to the actual pack dir
# that contain a directory called "mods"
#
# If that's not the case, the onus is on you to fix your shit and/or repack
# the server zip
#
directory="$(find modpack/ -type d -iname "mods" -execdir pwd \; | head -n 1)"
echo "Syncing from $directory/"
# Now we rsync everything from that directory here, which should set us up
rsync -av "$directory"/ ./

View File

@@ -0,0 +1,39 @@
#
# Licensed under the terms of the MIT license
# Source: https://github.com/agowa338/MinecraftSystemdUnit/
# vim:ft=dosini:
#
[Unit]
Description=Minecraft Server %i
After=network.target
[Service]
User=minecraft
Group=minecraft
WorkingDirectory={{ minecraft_home }}/%i
PrivateUsers=true
ProtectSystem=full
ProtectHome=true
# Implies MountFlags=slave
ProtectKernelTunables=true
# Implies NoNewPrivileges=yes
ProtectKernelModules=true
# Implies MountAPIVFS=yes
ProtectControlGroups=true
ExecStart=/bin/sh -c '/usr/bin/screen -DmS %i /usr/bin/java -Xms{{ minecraft_jre_xms }} -Xmx{{ minecraft_jre_xmx }} -jar server.jar nogui'
ExecReload=/usr/bin/screen -p 0 -S %i -X eval 'stuff "reload"\\015'
ExecStop=/usr/bin/screen -p 0 -S %i -X eval 'stuff "say Server is going down: Service was stopped"\\015'
ExecStop=/usr/bin/screen -p 0 -S %i -X eval 'stuff "save-all"\\015'
ExecStop=/usr/bin/screen -p 0 -S %i -X eval 'stuff "stop"\\015'
ExecStop=/bin/sleep 5
Restart=always
# Restart after 24hrs
RuntimeMaxSecs=86400
[Install]
WantedBy=multi-user.target