view routeflapper.rc.in @ 7:3c0db610c641

add bgpd config file and proper logrotate config
author Carl Byington <carl@five-ten-sg.com>
date Thu, 04 Sep 2014 08:53:18 -0700
parents 48d06780cf77
children
line wrap: on
line source

#!@BASH@
#
# routeflapper      This script controls the routeflapper daemon.
#
#
# chkconfig: 2345 60 40
# description: routeflapper monitors the bgp routes for new announcements
# processname: routeflapper
# pidfile: /var/run/routeflapper.pid
# Source function library.
#
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

RETVAL=0
# See how we were called.
case "$1" in
    start)
        # Start daemons.
        echo -n "Starting routeflapper: "
        if [ ! -f /var/lock/subsys/routeflapper ]; then
            cd SYSCONFDIR   # conf file is here
            SBINDIR/routeflapper -d 3
            RETVAL=$?
            pid=`pidof -s SBINDIR/routeflapper`
            if [ $pid ]
            then
                success "Starting routeflapper :"
                touch /var/lock/subsys/routeflapper
                echo
            else
                failure "Starting routeflapper:"
                echo
            fi
        else
            echo -n "already running! "
            failure "routeflapper already running!"
            echo
        fi

        ;;
    stop)
        # Stop daemons.
        echo -n "Shutting down routeflapper: "
        killproc routeflapper
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/routeflapper
        ;;
    restart|reload)
        $0 stop
        $0 start
        RETVAL=$?
        ;;
    status)
        status routeflapper
        RETVAL=$?
        ;;
    *)
        echo "Usage: routeflapper {start|stop|restart|reload|status}"
        exit 1
esac
exit $RETVAL