#!/bin/bash # # schoolbell: Starts the schoolbell calendar server # # chkconfig: - 80 14 # description: schoolbell calendar server # processname: /opt/schooltool-fork/schooltool-server.py # config: /opt/schooltool-fork/schooltool.conf # # Source function library. . /etc/init.d/functions PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/opt/schooltool-fork/cando.py NAME=schooltool DESC="SchoolTool" PNAME=schooltool PIDFILE=/opt/schooltool-fork/schooltool.pid SCRIPTNAME=/etc/init.d/cando.py CONFIGFILE=/opt/schooltool-fork/schooltool.conf DEFAULTFILE=/etc/sysconfig/schooltool # Gracefully exit if the package has been removed or is not configured. test -x $DAEMON || exit 0 test -f $CONFIGFILE || exit 0 if [ -r $DEFAULTFILE ]; then . $DEFAULTFILE fi start() { echo -n "Starting $DESC: $NAME" daemon $DAEMON --config=$CONFIGFILE & echo } stop() { echo -n "Stopping $DESC: $NAME" killproc $DAEMON echo "." } case "$1" in start) start ;; stop) stop ;; restart|force-reload) echo -n "Restarting $DESC: $NAME" stop start echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 1