updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / trousers / tcsd
blobbf04c98705a6fedc77a35cf571fa014e42894d7e
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON='tcsd'
7 TCSD=/usr/sbin/tcsd
8 PID=`pidof -o %PPID ${TCSD}`
10 case "$1" in
12 start)
13 stat_busy "Starting ${DAEMON}"
14 if [ -z "$PID" ]; then
15 $TCSD
17 if [ ! -z "$PID" -o $? -gt 0 ]; then
18 stat_fail
19 else
20 add_daemon ${DAEMON}
21 stat_done
25 stop)
26 stat_busy "Stopping ${DAEMON}"
27 [ ! -z "$PID" ] && kill $PID &> /dev/null
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 rm_daemon ${DAEMON}
32 stat_done
36 restart)
37 $0 stop
38 $0 start
42 echo "usage: $0 {start|stop|restart}"
44 esac
45 exit 0