Improving organization in the event that I add more scripts to this repo

This commit is contained in:
Henry Corse
2022-12-24 06:48:22 -05:00
parent d384b81d59
commit 169dd47aeb
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
[Unit]
Description=Minecraft Server
[Service]
Type=forking
User=minecraft
Group=minecraft
WorkingDirectory=/opt/minecraft
ExecStartPre=/opt/minecraft/scripts/rdify --init /opt/minecraft/world
ExecStart=/opt/minecraft/scripts/minecraft/mineserve start
ExecStartPost=screen -S mine_world_sync -dm /opt/minecraft/scripts/rdify --loop_sync 15 /opt/minecraft/world
ExecStop=screen -S mine_world_sync -X stuff ""
ExecStop=/opt/minecraft/scripts/minecraft/mineserve stop
ExecStopPost=/opt/minecraft/scripts/rdify --sync /opt/minecraft/world
ExecStopPost=/opt/minecraft/scripts/rdify --cleanup /opt/minecraft/world
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target