Working code

These files update.pl, server.bash and builstable.bash are working scripts that are actively used by me. Therefore, I feel they are ready to be added here.
This commit is contained in:
kake26 2022-11-18 21:53:41 +00:00
parent db76f525d7
commit bf4e7fc555
3 changed files with 145 additions and 0 deletions

29
server.bash Normal file
View file

@ -0,0 +1,29 @@
#!/bin/bash
# script to start and stop minetest server
if [[ $1 == "start" ]]
then
echo "STARTING"
/home/kake26/minetest-5.6.1/bin/minetestserver --quiet --logfile /home/kake26/minetest/minetest.log --config /home/kake26/minetest/conf/minetest.conf --world /home/kake26/minetest/minetest-server/.minetest/worlds/world2/ &
pid=$!
echo $pid > /home/kake26/minetest/mintest.pid
fi
if pidof minetestserver
then
# Horribly cheap but works
echo "OK"
else
# Seriously why not
/home/kake26/minetest-5.6.1/bin/minetestserver --quiet --logfile /home/kake26/minetest/minetest.log --config /home/kake26/minetest/conf/minetest.conf --world /home/kake26/minetest/minetest-server/.minetest/worlds/world2/ &
fi
if [[ $1 == "stop" ]]
then
echo "STOPING"
$(pidof minetestserver | xargs kill -s INT)
fi
exit 0