network/bitlbee: Fix restart command.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
William G Gardella 2015-08-29 06:32:50 +07:00 committed by Willy Sudiarto Raharjo
parent a47d0333a5
commit 5f4c70254f

View file

@ -1,28 +1,28 @@
#!/bin/sh #!/bin/sh
# /etc/rc.d/rc.bitlbee - Start/stop/restart the bitlbee daemon. # /etc/rc.d/rc.bitlbee - Start/stop/restart the bitlbee daemon.
# To make bitlbee start automatically at boot, make this # To make bitlbee start automatically at boot, make this
# file executable: chmod 0755 /etc/rc.d/rc.bitlbee and add it # file executable: chmod 0755 /etc/rc.d/rc.bitlbee and add it
# to slackware's startup scripts (ie: rc.local) # to slackware's startup scripts (ie: rc.local)
# #
BITLBEE_CONFIG="/etc/bitlbee/bitlbee.conf" BITLBEE_CONFIG="/etc/bitlbee/bitlbee.conf"
BITLBEE_PORT="6667" BITLBEE_PORT="6667"
BITLBEE_OPTS="-F" BITLBEE_OPTS="-F"
PIDFILE="/var/run/bitlbee.pid" PIDFILE="/var/run/bitlbee.pid"
SOCKFILE="/var/run/bitlbee.sock" SOCKFILE="/var/run/bitlbee.sock"
bitlbee_start() { bitlbee_start() {
echo "Starting bitlbee on port $BITLBEE_PORT..." echo "Starting bitlbee on port $BITLBEE_PORT..."
CHECK=$(ps aux | grep /usr/sbin/bitlbee | grep -v grep) CHECK=$(ps aux | grep /usr/sbin/bitlbee | grep -v grep)
STATUS=$? STATUS=$?
# make sure bitlbee isn't running yet # make sure bitlbee isn't running yet
if [ "$STATUS" == "1" ]; then if [ "$STATUS" == "1" ]; then
touch $PIDFILE touch $PIDFILE
chown bitlbee:bitlbee $PIDFILE chown bitlbee:bitlbee $PIDFILE
# Start bitlbee in forked mode. # Start bitlbee in forked mode.
# /usr/sbin/bitlbee -c $BITLBEE_CONFIG # if you have configured bitlbee properly. # /usr/sbin/bitlbee -c $BITLBEE_CONFIG # if you have configured bitlbee properly.
/usr/sbin/bitlbee -u bitlbee -p $BITLBEE_PORT $BITLBEE_OPTS /usr/sbin/bitlbee -u bitlbee -p $BITLBEE_PORT $BITLBEE_OPTS
@ -33,7 +33,7 @@ bitlbee_start() {
exit 1 exit 1
fi fi
} }
bitlbee_stop() { bitlbee_stop() {
echo -n "Stopping bitlbee..." echo -n "Stopping bitlbee..."
# Are we running a normal daemon or are we forked # Are we running a normal daemon or are we forked
@ -49,7 +49,7 @@ bitlbee_stop() {
echo "done" echo "done"
fi fi
} }
# Let's see how we are being called. # Let's see how we are being called.
case "$1" in case "$1" in
start) start)
@ -59,9 +59,9 @@ case "$1" in
bitlbee_stop bitlbee_stop
;; ;;
restart) restart)
bitlbee_start
sleep 3
bitlbee_stop bitlbee_stop
sleep 3
bitlbee_start
;; ;;
*) *)
echo "Usage: $(basename $0) {start|stop|restart}" echo "Usage: $(basename $0) {start|stop|restart}"