]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/packages/frr
frr: Add initscript
[people/pmueller/ipfire-2.x.git] / src / initscripts / packages / frr
1 #!/bin/sh
2 ########################################################################
3 # Begin $rc_base/init.d/frr
4 #
5 # Description : FRRouting Suite
6 #
7 ########################################################################
8
9 . /etc/sysconfig/rc
10 . ${rc_functions}
11
12 DAEMONS="zebra bgpd ospfd staticd"
13
14 case "${1}" in
15 start)
16 for daemon in ${DAEMONS}; do
17 if [ -f "/etc/frr/${daemon}.conf" ]; then
18 boot_mesg "Starting FRRouting ${daemon}..."
19 loadproc "/usr/sbin/${daemon}" --daemon
20 fi
21 done
22 ;;
23
24 stop)
25 for daemon in ${DAEMONS}; do
26 boot_mesg "Stopping FRRouting ${daemon}..."
27 killproc "/usr/sbin/${daemon}"
28 done
29 ;;
30
31 reload)
32 boot_mesg "Reloading FRRouting..."
33 reloadproc /usr/sbin/frr-reload
34 ;;
35
36 restart)
37 ${0} stop
38 sleep 1
39 ${0} start
40 ;;
41
42 status)
43 for daemon in ${DAEMONS}; do
44 statusproc "/usr/sbin/${daemon}"
45 done
46 ;;
47
48 *)
49 echo "Usage: ${0} {start|stop|reload|restart|status}"
50 exit 1
51 ;;
52 esac
53
54 # End $rc_base/init.d/frr