forked from nalc/nalc-server
Rewrite of the install script
This commit is contained in:
@ -1,29 +1,39 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This is a startup script example you can adapt for your needs.
|
||||
# It can take a server directory to start as argument else,
|
||||
# it will use the current dir.
|
||||
# If you want to use it, rename it to 'start.sh' and give it executable rights.
|
||||
#
|
||||
# If you want to start/stop the server as a system service you should not use this
|
||||
# script. Please read the documentation for more informations.
|
||||
#
|
||||
|
||||
serverpath=/home/minetest/nalc-server
|
||||
world=$serverpath/minetest/worlds/nalc
|
||||
serverdir="$1"
|
||||
[ -z "$serverdir" ] && serverdir="$(pwd)"
|
||||
if [ ! -e "$serverdir/nalc.conf" ]; then
|
||||
echo "ERROR: nalc.conf not found!"
|
||||
exit 1
|
||||
else
|
||||
. "$serverdir/nalc.conf"
|
||||
fi
|
||||
|
||||
DEBUG=$serverpath/logs/debug.log
|
||||
MOREDEBUG=$serverpath/logs/moredebug.log
|
||||
#DEBUG=$serverdir/logs/debug.log
|
||||
#MOREDEBUG=$serverdir/logs/moredebug.log
|
||||
|
||||
cd $serverpath/minetest/bin
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 5
|
||||
|
||||
echo "----------------------" >>$MOREDEBUG
|
||||
echo "Server restarted at "`date` >>$MOREDEBUG
|
||||
echo "----------------------" >>$MOREDEBUG
|
||||
#while true; do
|
||||
# sleep 5
|
||||
# echo "----------------------" >>$MOREDEBUG
|
||||
# echo "Server restarted at "`date` >>$MOREDEBUG
|
||||
# echo "----------------------" >>$MOREDEBUG
|
||||
|
||||
echo "0" >/tmp/players_c.txt
|
||||
|
||||
./minetestserver \
|
||||
--world $world/ \
|
||||
--config $serverpath/minetest/minetest.conf \
|
||||
"$MINETEST_BIN" \
|
||||
--world "$MINETEST_DIR/worlds/$WORLD_NAME/" \
|
||||
--config "$MINETEST_DIR/minetest.conf" \
|
||||
--gameid nalc_game \
|
||||
--port 30002 \
|
||||
# --logfile $DEBUG
|
||||
--port $PORT \
|
||||
# --logfile $DEBUG
|
||||
|
||||
sleep 25
|
||||
done &>> $MOREDEBUG
|
||||
#done &>> $MOREDEBUG
|
||||
|
Reference in New Issue
Block a user