34 lines
No EOL
755 B
Desktop File
34 lines
No EOL
755 B
Desktop File
#! /bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: Django-Server
|
|
# Required-Start: $all
|
|
# Required-Stop:
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Django Server
|
|
### END INIT INFO
|
|
|
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
|
|
|
|
# If you need to source some other scripts, do it here
|
|
|
|
case "$1" in
|
|
start)
|
|
log_begin_msg "Starting Saleor Server"
|
|
python3 "{hd}/saleor/manage.py" runserver {hostip}:8000 --insecure &
|
|
log_end_msg $?
|
|
exit 0
|
|
;;
|
|
stop)
|
|
log_begin_msg "Stopping Saleor Server"
|
|
|
|
# do something to kill the service or cleanup or nothing
|
|
|
|
log_end_msg $?
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/saleor {start|stop}"
|
|
exit 1
|
|
;;
|
|
esac |