Make some fixes to the linux/unix start scripts.
This commit is contained in:
parent
bffc8b04d8
commit
f2fda4b1bd
2 changed files with 22 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Evennia init.d Screen launcher script (Linux)
|
# Evennia init.d Screen launcher script (Linux)
|
||||||
#
|
#
|
||||||
|
|
@ -33,4 +34,14 @@ SCRIPTPATH="/home/muddev/mud/mygame/server/evennia-screen.sh"
|
||||||
USER="muddev"
|
USER="muddev"
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
su - "$USER" -c "$SCRIPTPATH $1"
|
case $1 in
|
||||||
|
start | stop | reload | restart)
|
||||||
|
# run the start script and forward the argument to it
|
||||||
|
su - "$USER" -c "$SCRIPTPATH $1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: evennia {start|stop|restart|reload}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit 0
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ case $1 in
|
||||||
echo "(Re-)Starting Evennia."
|
echo "(Re-)Starting Evennia."
|
||||||
cd "$GAMEDIR"
|
cd "$GAMEDIR"
|
||||||
touch "$GAMEDIR"/server/logs/server.log
|
touch "$GAMEDIR"/server/logs/server.log
|
||||||
screen -S $GAMENAME -p evennia -X stuff 'evennia start --log \n'
|
screen -S $GAMENAME -p evennia -X stuff 'evennia --log start\n'
|
||||||
else
|
else
|
||||||
# start GNU Screen then run it with this same script, making sure to
|
# start GNU Screen then run it with this same script, making sure to
|
||||||
# not start Screen on the second call
|
# not start Screen on the second call
|
||||||
|
|
@ -51,8 +51,14 @@ case $1 in
|
||||||
# this is executed inside the GNU Screen session
|
# this is executed inside the GNU Screen session
|
||||||
source "$VIRTUALENV"/bin/activate
|
source "$VIRTUALENV"/bin/activate
|
||||||
cd "$GAMEDIR"
|
cd "$GAMEDIR"
|
||||||
|
# these will fail unless server died uncleanly
|
||||||
|
rm "$GAMEDIR"/server/server.pid
|
||||||
|
rm "$GAMEDIR"/server/portal.pid
|
||||||
|
# make sure it exists for the first startup
|
||||||
touch "$GAMEDIR"/server/logs/server.log
|
touch "$GAMEDIR"/server/logs/server.log
|
||||||
evennia start
|
# start evennia itself
|
||||||
|
evennia --log start
|
||||||
|
# we must run this to avoid the screen session exiting immediately
|
||||||
exec sh
|
exec sh
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
@ -63,11 +69,11 @@ case $1 in
|
||||||
;;
|
;;
|
||||||
reload | restart)
|
reload | restart)
|
||||||
cd "$GAMEDIR"
|
cd "$GAMEDIR"
|
||||||
screen -S "$GAMENAME" -p evennia -X stuff 'evennia reload --log\n'
|
screen -S "$GAMENAME" -p evennia -X stuff 'evennia --log reload\n'
|
||||||
echo "Reloading Evennia."
|
echo "Reloading Evennia."
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: start_evennia {start|stop|restart|reload}"
|
echo "Usage: evennia-screen.sh {start|stop|restart|reload}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue