#!/bin/sh
#
# supertail     Startup script for the supertail process
#
# chkconfig:   - 85 15
# description: convert log file into syslog stream
#
# processname: supertail
# pidfile:     /var/run/supertail.pid
#

exec="/usr/local/sbin/supertail"
prog=`basename $exec`
PIDFILE=/var/run/supertail.pid

[ -s /etc/default/supertail ] && . /etc/default/supertail

start() {
    [ -x $exec ] || exit 5
    printf "Starting $prog: "
    $exec $LOGFILES &
    retval=$?
    echo
    return $retval
}

stop() {
    printf "Stopping $prog: "
    # stop it here, often "killproc $prog"
    [ -f $PIDFILE ] && kill `head -1 $PIDFILE`
    retval=$?
    echo
    return $retval
}

restart() {
    stop
    start
}

reload() {
    restart
}

case "$1" in
    start)
        $1
        ;;
    stop)
        $1
        ;;
    restart)
        $1
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 2
esac
exit $?

