From 169dd47aeb0a77db69a0f692231d04ef05531447 Mon Sep 17 00:00:00 2001 From: Henry Corse Date: Sat, 24 Dec 2022 06:48:22 -0500 Subject: [PATCH] Improving organization in the event that I add more scripts to this repo --- minecraft/minecraft.service | 25 +++++++++++++++++++++++++ mineserve => minecraft/mineserve | 0 2 files changed, 25 insertions(+) create mode 100644 minecraft/minecraft.service rename mineserve => minecraft/mineserve (100%) diff --git a/minecraft/minecraft.service b/minecraft/minecraft.service new file mode 100644 index 0000000..8c10930 --- /dev/null +++ b/minecraft/minecraft.service @@ -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 diff --git a/mineserve b/minecraft/mineserve similarity index 100% rename from mineserve rename to minecraft/mineserve