forked from axiom-team/astrXbian
ENH: Ajout service systemd
This commit is contained in:
parent
4fd2655c4d
commit
daff2d8b2c
Binary file not shown.
|
@ -4,8 +4,7 @@ MINETEST_PATH=/home/pi/.minetest
|
|||
WORLD_NAME=astroport
|
||||
WORLD_PATH=$MINETEST_PATH/worlds/$WORLD_NAME
|
||||
|
||||
rm -R $WORLD_PATH
|
||||
|
||||
rm -rf $WORLD_PATH
|
||||
mkdir $WORLD_PATH
|
||||
|
||||
cp map.sqlite $WORLD_PATH/
|
||||
|
@ -53,6 +52,56 @@ port = 30001
|
|||
|
||||
" >> /home/pi/.minetest/worlds/astroport/minetest.conf
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#########################################################################################
|
||||
#
|
||||
# SystemD
|
||||
#
|
||||
#########################################################################################
|
||||
|
||||
|
||||
MINETEST_LOG_FILE=/var/log/minetest/minetest-astroport.log
|
||||
|
||||
sudo touch $MINETEST_LOG_FILE
|
||||
sudo chown pi:games $MINETEST_LOG_FILE
|
||||
chmod 664 $MINETEST_LOG_FILE
|
||||
|
||||
echo "
|
||||
[Unit]
|
||||
Description=Minetest multiplayer server minetest.conf server config
|
||||
Documentation=man:minetestserver(6)
|
||||
After=network.target
|
||||
RequiresMountsFor=/var/games/minetest-server
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
User=pi
|
||||
Group=games
|
||||
ExecStart=/usr/lib/minetest/minetestserver --port 30001 --world /home/pi/.minetest/worlds/astroport --config /home/pi/.minetest/worlds/astroport/minetest.conf --logfile /var/log/minetest/minetest-astroport.log
|
||||
StandardOutput=null
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
" >> $WORLD_PATH/systemd.service
|
||||
|
||||
sudo systemctl enable $WORLD_PATH/systemd.service
|
||||
|
||||
sudo systemctl start astroport-minetest.service
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#########################################################################################
|
||||
#
|
||||
# MODS
|
||||
#
|
||||
#########################################################################################
|
||||
|
||||
|
||||
mkdir $WORLD_PATH/worldmods
|
||||
|
||||
if [ ! -d $MINETEST_PATH/mods ]; then
|
||||
|
|
Loading…
Reference in New Issue