]>
Commit | Line | Data |
---|---|---|
ebd6fe2b MT |
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) | |
e1def10e MT |
16 | # Fix permissions of configuration directory |
17 | if [ -d "/etc/frr" ]; then | |
18 | chown root.frr /etc/frr | |
19 | chmod 775 /etc/frr | |
20 | fi | |
21 | ||
ebd6fe2b MT |
22 | for daemon in ${DAEMONS}; do |
23 | if [ -f "/etc/frr/${daemon}.conf" ]; then | |
e1def10e MT |
24 | # Set permissions |
25 | chown frr.frr "/etc/frr/${daemon}.conf" | |
26 | ||
ebd6fe2b MT |
27 | boot_mesg "Starting FRRouting ${daemon}..." |
28 | loadproc "/usr/sbin/${daemon}" --daemon | |
29 | fi | |
30 | done | |
31 | ;; | |
32 | ||
33 | stop) | |
34 | for daemon in ${DAEMONS}; do | |
35 | boot_mesg "Stopping FRRouting ${daemon}..." | |
36 | killproc "/usr/sbin/${daemon}" | |
37 | done | |
38 | ;; | |
39 | ||
40 | reload) | |
41 | boot_mesg "Reloading FRRouting..." | |
42 | reloadproc /usr/sbin/frr-reload | |
43 | ;; | |
44 | ||
45 | restart) | |
46 | ${0} stop | |
47 | sleep 1 | |
48 | ${0} start | |
49 | ;; | |
50 | ||
51 | status) | |
52 | for daemon in ${DAEMONS}; do | |
53 | statusproc "/usr/sbin/${daemon}" | |
54 | done | |
55 | ;; | |
56 | ||
57 | *) | |
58 | echo "Usage: ${0} {start|stop|reload|restart|status}" | |
59 | exit 1 | |
60 | ;; | |
61 | esac | |
62 | ||
63 | # End $rc_base/init.d/frr |