Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- NAME=sage-server
- PIDFILE=/home/sage/.sage/sage_notebook.sagenb/sagenb.pid
- case "$1" in
- start)
- if [ -f "$PIDFILE" ]; then
- echo "Server $NAME is running"
- else
- echo "Starting $NAME"
- /bin/su -c 'echo "import sagenb.notebook.notebook_object as nb; nb.notebook(interface=\"127.0.0.1\")" | /home/sage/sage-6.5/sage -python &' - sage
- fi
- ;;
- stop)
- if [ -f "$PIDFILE" ]; then
- kill `cat $PIDFILE`
- else
- echo "Server $NAME is not running"
- fi
- ;;
- restart)
- echo "Restarting daemon: " $NAME
- if [ -f "$PIDFILE" ]; then
- kill `cat $PIDFILE`
- sleep 10
- fi
- echo "Starting $NAME"
- /bin/su -c 'echo "import sagenb.notebook.notebook_object as nb; nb.notebook(interface=\"127.0.0.1\")" | /home/sage/sage-6.5/sage -python &' - sage
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement