updated on Fri Jan 6 00:09:29 UTC 2012
[aur-mirror.git] / mgetty / faxrunqd
blobf033da43e3132d8affe69b0e1c2b8683a4b9ce61
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 # . /etc/mgetty+sendfax/faxrunq.config
7 PID=`pidof -x -o %PPID /usr/sbin/faxrunqd`
8 case "$1" in
9 start)
10 stat_busy "Starting faxrunqd"
11 if [ -z "$PID" ]; then
12 su fax -c /usr/sbin/faxrunqd &
13 # su -c /usr/sbin/faxrunqd &
15 if [ ! -z "$PID" -o $? -gt 0 ]; then
16 stat_fail
17 else
18 PID=`pidof -x -o %PPID /usr/sbin/faxrundq`
19 echo $PID > /var/run/faxrunqd.pid
20 add_daemon faxrunqd
21 stat_done
24 stop)
25 stat_busy "Stopping faxrunqd"
26 [ ! -z "$PID" ] && kill $PID &> /dev/null
27 if [ $? -gt 0 ]; then
28 stat_fail
29 else
30 rm_daemon faxrunqd
31 stat_done
34 restart)
35 $0 stop
36 sleep 1
37 $0 start
40 echo "usage: $0 {start|stop|restart}"
41 esac