diff options
author | Michiel van Wessem <michiel@slackbuilds.org> | 2011-07-16 20:15:50 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2011-07-16 20:15:50 -0500 |
commit | 5156729c640c9274805b45f98c9ccbfdfcebbcc1 (patch) | |
tree | 139c2aabb9346456472bbab23f5b5aa7d5b855e7 /network/bitlbee/rc.bitlbee | |
parent | e3e945dc02f02968a8a3e10654f5def0ea421612 (diff) | |
download | slackbuilds-5156729c640c9274805b45f98c9ccbfdfcebbcc1.tar.gz |
network/bitlbee: Updated for version 3.0.3.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/bitlbee/rc.bitlbee')
-rw-r--r-- | network/bitlbee/rc.bitlbee | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/network/bitlbee/rc.bitlbee b/network/bitlbee/rc.bitlbee new file mode 100644 index 0000000000..5f0ef7ad00 --- /dev/null +++ b/network/bitlbee/rc.bitlbee @@ -0,0 +1,70 @@ +#!/bin/sh + +# /etc/rc.d/rc.bitlbee - Start/stop/restart the bitlbee daemon. +# To make bitlbee start automatically at boot, make this +# file executable: chmod 0755 /etc/rc.d/rc.bitlbee and add it +# to slackware's startup scripts (ie: rc.local) +# + +BITLBEE_CONFIG="/etc/bitlbee/bitlbee.conf" +BITLBEE_PORT="6667" +BITLBEE_OPTS="-F" + +PIDFILE="/var/run/bitlbee.pid" +SOCKFILE="/var/run/bitlbee.sock" + +bitlbee_start() { + echo "Starting bitlbee on port $BITLBEE_PORT..." + CHECK=$(ps aux | grep /usr/sbin/bitlbee | grep -v grep) + STATUS=$? + + # make sure bitlbee isn't running yet + if [ "$STATUS" == "1" ]; then + touch $PIDFILE + chown bitlbee:bitlbee $PIDFILE + + # Start bitlbee in forked mode. + # /usr/sbin/bitlbee -c $BITLBEE_CONFIG # if you have configured bitlbee properly. + /usr/sbin/bitlbee -u bitlbee -p $BITLBEE_PORT $BITLBEE_OPTS + else + echo "bitlbee is already active and running under PID: $(cat $PIDFILE)" + echo "if you think this is wrong, remove the offending PID file" + echo "and restart bitlbee" + exit 1 + fi +} + +bitlbee_stop() { + echo -n "Stopping bitlbee..." + # Are we running a normal daemon or are we forked + if [ "$BITLBEE_OPTS" == "-D" ]; then + if [ -r $PIDFILE ]; then + kill $(cat $PIDFILE) + rm $PIDFILE $SOCKFILE + echo "done" + fi + else + killall bitlbee + rm $PIDFILE $SOCKFILE + echo "done" + fi +} + +# Let's see how we are being called. +case "$1" in + start) + bitlbee_start + ;; + stop) + bitlbee_stop + ;; + restart) + bitlbee_start + sleep 3 + bitlbee_stop + ;; + *) + echo "Usage: $(basename $0) {start|stop|restart}" + exit 1 + ;; +esac |