Minecraft-Server-Tools/minecraft@.service

20 lines
413 B
INI
Raw Permalink Normal View History

2021-10-09 21:01:09 +02:00
[Unit]
Description=Minecraft Server: %i
After=network.target
[Service]
WorkingDirectory=/var/minecraft/instances/%i
User=minecraft
Group=minecraft
Restart=no
ExecStart=/usr/bin/screen -DmS minecraft-%i ./start_server.sh
ExecStop=/usr/bin/screen -p 0 -S minecraft-%i -X eval 'stuff "save-all"\015'
ExecStop=/usr/bin/screen -p 0 -S minecraft-%i -X eval 'stuff "stop"\015'
[Install]
WantedBy=multi-user.target