]>
Commit | Line | Data |
---|---|---|
ebd6fe2b | 1 | #!/bin/sh |
66c36198 PM |
2 | ############################################################################### |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
5 | # Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> # | |
6 | # # | |
7 | # This program is free software: you can redistribute it and/or modify # | |
8 | # it under the terms of the GNU General Public License as published by # | |
9 | # the Free Software Foundation, either version 3 of the License, or # | |
10 | # (at your option) any later version. # | |
11 | # # | |
12 | # This program is distributed in the hope that it will be useful, # | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
15 | # GNU General Public License for more details. # | |
16 | # # | |
17 | # You should have received a copy of the GNU General Public License # | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
19 | # # | |
20 | ############################################################################### | |
ebd6fe2b MT |
21 | |
22 | . /etc/sysconfig/rc | |
23 | . ${rc_functions} | |
24 | ||
25 | DAEMONS="zebra bgpd ospfd staticd" | |
26 | ||
27 | case "${1}" in | |
28 | start) | |
e1def10e MT |
29 | # Fix permissions of configuration directory |
30 | if [ -d "/etc/frr" ]; then | |
31 | chown root.frr /etc/frr | |
32 | chmod 775 /etc/frr | |
33 | fi | |
34 | ||
ebd6fe2b MT |
35 | for daemon in ${DAEMONS}; do |
36 | if [ -f "/etc/frr/${daemon}.conf" ]; then | |
e1def10e MT |
37 | # Set permissions |
38 | chown frr.frr "/etc/frr/${daemon}.conf" | |
39 | ||
ebd6fe2b MT |
40 | boot_mesg "Starting FRRouting ${daemon}..." |
41 | loadproc "/usr/sbin/${daemon}" --daemon | |
42 | fi | |
43 | done | |
44 | ;; | |
45 | ||
46 | stop) | |
47 | for daemon in ${DAEMONS}; do | |
48 | boot_mesg "Stopping FRRouting ${daemon}..." | |
49 | killproc "/usr/sbin/${daemon}" | |
50 | done | |
51 | ;; | |
52 | ||
53 | reload) | |
54 | boot_mesg "Reloading FRRouting..." | |
55 | reloadproc /usr/sbin/frr-reload | |
56 | ;; | |
57 | ||
58 | restart) | |
59 | ${0} stop | |
60 | sleep 1 | |
61 | ${0} start | |
62 | ;; | |
63 | ||
64 | status) | |
65 | for daemon in ${DAEMONS}; do | |
66 | statusproc "/usr/sbin/${daemon}" | |
67 | done | |
68 | ;; | |
69 | ||
70 | *) | |
71 | echo "Usage: ${0} {start|stop|reload|restart|status}" | |
72 | exit 1 | |
73 | ;; | |
74 | esac |