Changes of Revision 9
[-] [+] | Changed | bird.spec |
[-] [+] | Added | bird.init.suse ^ |
@@ -0,0 +1,102 @@ +#! /bin/sh +# +# bird Starts the Internet Routing Daemon. +# +# Author: Ondrej Feela Filip, <feela@network.cz> +# +# chkconfig: - 32 75 +# description: Internet routing daemon supporting IPv4 routing protocols: +# BGP4, RIPv2 and OSPFv2. +# +# processname: bird +# config: /etc/bird.conf +### BEGIN INIT INFO +# Provides: bird +# Required-Start: $network $remote_fs +# Required-Stop: $network $remote_fs +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Description: Starts bird +### END INIT INFO + +BIRD_SYSCONFIG=/etc/sysconfig/bird +test -r $BIRD_SYSCONFIG || exit 6 +. $BIRD_SYSCONFIG + +BIRD4_PIDFILE=/var/run/bird4.init.pid +BIRD6_PIDFILE=/var/run/bird6.init.pid +BIRD4_BIN=/usr/sbin/bird +BIRD6_BIN=/usr/sbin/bird6 +. /etc/rc.status + +# Shell functions sourced from /etc/rc.status: +# rc_check check and set local and overall rc status +# rc_status check and set local and overall rc status +# rc_status -v ditto but be verbose in local rc status +# rc_status -v -r ditto and clear the local rc status +# rc_failed set local and overall rc status to failed +# rc_reset clear local rc status (overall remains) +# rc_exit exit appropriate to overall rc status + +# First reset status of this service +rc_reset + +BIRD4="yes" +BIRD6="yes" + +[ -f /etc/bird.conf ] || BIRD4="no" +[ -f "${BIRD4_BIN}" ] || BIRD4="no" + +[ -f /etc/bird-6.conf ] || BIRD6="no" +[ -f "${BIRD6_BIN}" ] || BIRD6="no" + +# See how we were called. +case "$1" in + start) + if [ "$BIRD4" = "yes" ] + then + echo -n "Starting BIRD for IPv4: " + startproc -f -p $BIRD4_PIDFILE $BIRD4_BIN $BIRD4_OPTS + rc_status -v + fi + if [ "$BIRD6" = "yes" ] + then + echo -n "Starting BIRD for IPv6: " + startproc -f -p $BIRD6_PIDFILE $BIRD6_BIN $BIRD6_OPTS + rc_status -v + fi + ;; + stop) + echo -n "Stopping BIRD for IPv4: " + killproc -p $BIRD4_PIDFILE $BIRD4_BIN + rc_status -v + + echo -n "Stopping BIRD for IPv6: " + killproc -p $BIRD6_PIDFILE $BIRD6_BIN + rc_status -v + ;; + status) + echo -n "Checking BIRD for IPv4: " + checkproc -p $BIRD4_PIDFILE $BIRD4_BIN + rc_status -v + echo -n "Checking BIRD for IPv6: " + checkproc -p $BIRD6_PIDFILE $BIRD6_BIN + rc_status -v + ;; + restart) + $0 stop + $0 start + ;; + reload) + echo -n "Reloading BIRD for IPv4: " + killproc -p $BIRD4_PIDFILE -HUP $BIRD4_BIN + rc_status -v + echo -n "Reloading BIRD for IPv6: " + killproc -p $BIRD6_PIDFILE -HUP $BIRD6_BIN + rc_status -v + ;; + *) + echo "Usage: $0 {start|stop|status|restart|reload}" + exit 1 +esac +rc_exit |