Scan media entities as well, not just url entities. This should expand more
[bitlbee.git] / debian / bitlbee-common.init
blobfd10b0affcf0f010441cbb1def2ff562370ed2eb
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides: bitlbee
4 # Required-Start: $remote_fs $syslog
5 # Required-Stop: $remote_fs $syslog
6 # Default-Start: 2 3 4 5
7 # Default-Stop: 0 1 6
8 # Short-Description: Start and stop BitlBee IRC to other chat networks gateway
9 ### END INIT INFO
12 # Version: @(#)skeleton 2.85-23 28-Jul-2004 miquels@cistron.nl
15 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16 DESC="BitlBee IRC/IM gateway"
17 NAME=bitlbee
18 DAEMON=/usr/sbin/$NAME
19 PIDFILE=/var/run/$NAME.pid
20 SCRIPTNAME=/etc/init.d/$NAME
22 # Gracefully exit if the package has been removed.
23 [ -x $DAEMON ] || exit 0
25 # Default value
26 BITLBEE_PORT=6667
27 BITLBEE_OPTS=-F
29 # Read config file if it is present.
30 if [ -r /etc/default/$NAME ]; then
31 . /etc/default/$NAME
36 # Function that starts the daemon/service.
38 d_start() {
39 # Make sure BitlBee can actually write its PID...
40 touch $PIDFILE
41 chown bitlbee: $PIDFILE
43 start-stop-daemon --start --quiet --pidfile $PIDFILE \
44 --exec $DAEMON -- -p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS
48 # Function that stops the daemon/service.
50 d_stop() {
51 start-stop-daemon --stop --quiet --pidfile $PIDFILE \
52 --name $NAME
56 case "$1" in
57 start)
58 [ "$BITLBEE_DISABLED" = "1" ] && exit 0
60 echo -n "Starting $DESC: $NAME"
61 d_start
62 echo "."
64 stop)
65 echo -n "Stopping $DESC: $NAME"
66 d_stop
67 echo "."
69 #reload)
71 # No reload target, but there's a REHASH command which we
72 # might use later...
74 #;;
75 restart|force-reload)
76 echo -n "Restarting $DESC: $NAME"
77 d_stop
78 sleep 1
79 d_start
80 echo "."
83 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
84 exit 1
86 esac
88 exit 0