mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 13:07:16 +02:00
added stop fonctionaly into the script as it is useful for daemon mode.
This commit is contained in:
parent
c8e460e668
commit
7b53efac69
1 changed files with 11 additions and 0 deletions
11
startup.sh
11
startup.sh
|
|
@ -3,10 +3,12 @@
|
|||
# SERVER STARTUP SCRIPT
|
||||
# Sets the appropriate environmental variables and launches the server
|
||||
# process. Run without flags for daemon mode.
|
||||
# It can be used for stoping the server.
|
||||
#
|
||||
# FLAGS
|
||||
# -i Interactive mode
|
||||
# -d Daemon mode
|
||||
# -s Stop the running server
|
||||
# -h Show help display
|
||||
#############################################################################
|
||||
|
||||
|
|
@ -30,6 +32,11 @@ startup_daemon() {
|
|||
twistd --logfile=logs/evennia.log --python=src/server.py
|
||||
}
|
||||
|
||||
stop_server() {
|
||||
## Stops the running server
|
||||
kill `cat twistd.pid`
|
||||
}
|
||||
|
||||
help_display() {
|
||||
echo "SERVER STARTUP SCRIPT"
|
||||
echo "Sets the appropriate environmental variables and launches the server"
|
||||
|
|
@ -38,6 +45,7 @@ help_display() {
|
|||
echo "FLAGS"
|
||||
echo " -i Interactive mode"
|
||||
echo " -d Daemon mode"
|
||||
echo " -s Stop the running server"
|
||||
echo " -h Show help display"
|
||||
|
||||
}
|
||||
|
|
@ -49,6 +57,9 @@ case "$1" in
|
|||
'-d')
|
||||
startup_daemon
|
||||
;;
|
||||
'-s')
|
||||
stop_server
|
||||
;;
|
||||
'--help')
|
||||
help_display
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue