-
Notifications
You must be signed in to change notification settings - Fork 11
/
fyrqd-debian.ugly
executable file
·52 lines (44 loc) · 1.28 KB
/
fyrqd-debian.ugly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/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: fyrqd is a daemon running the WriteToThem queue
# Description: fyrqd run the WriteToThem queue to send emails and faxes to representatives
### END INIT INFO
#
# !!(*= $daemon_name *)!! Start the WriteToThem queue daemon
NAME=!!(*= $daemon_name *)!!
DAEMON=/data/vhost/!!(*= $vhost *)!!/writetothem/bin/fyrqd
PIDFILE=/data/vhost/!!(*= $vhost *)!!/fyrqd.pid
DUSER=!!(*= $user *)!!
trap "" 1
case "$1" in
start)
echo -n "Starting WriteToThem queue daemon: $NAME"
start-stop-daemon --start --pidfile $PIDFILE --chuid $DUSER --exec $DAEMON > /dev/null
;;
stop)
echo -n "Stopping WriteToThem queue daemon: $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo
;;
restart)
echo -n "Restarting WriteToThem queue 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