Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 53 lines (44 sloc) 1.3 KB
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: !!(*= $daemon_name *)!!
# Required-Start: $local_fs $syslog postgresql
# Required-Stop: $local_fs $syslog postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: !!(*= $daemon_name *)!! is a daemon running the PledgeBank SMS queue
# Description: !!(*= $daemon_name *)!! runs the PledgeBank queue to send and receive SMS on pledges
### END INIT INFO
#
# !!(*= $daemon_name *)!! - Start the PledgeBank SMS daemon
NAME=!!(*= $daemon_name *)!!
DAEMON=/data/vhost/!!(*= $vhost *)!!/pledgebank/bin/pbsmsd
PIDFILE=/data/vhost/!!(*= $vhost *)!!/pbsmsd.pid
DUSER=!!(*= $user *)!!
trap "" 1
case "$1" in
start)
echo -n "Starting PledgeBank SMS daemon: $NAME"
start-stop-daemon --start --pidfile $PIDFILE --chuid $DUSER --exec $DAEMON > /dev/null
;;
stop)
echo -n "Stopping PledgeBank SMS daemon: $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo
;;
restart)
echo -n "Restarting PledgeBank SMS daemon: $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo
start-stop-daemon --start --pidfile $PIDFILE --chuid $DUSER --exec $DAEMON > /dev/null
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac
if [ $? -eq 0 ]; then
echo .
exit 0
else
echo " failed"
exit 1
fi
Jump to Line
Something went wrong with that request. Please try again.