]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/initscripts/packages/frr
frr: Update reloading all services
[people/pmueller/ipfire-2.x.git] / src / initscripts / packages / frr
CommitLineData
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
7c6b05df 25DAEMONS="mgmtd zebra bgpd ospfd staticd"
ebd6fe2b
MT
26
27case "${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)
56d32cbe
MT
54 # Reload all daemons
55 for daemon in ${DAEMONS}; do
56 boot_mesg "Reloading FRRouting ${daemon}..."
57 reloadproc "/usr/sbin/${daemon}"
58 done
ebd6fe2b
MT
59 ;;
60
61 restart)
62 ${0} stop
63 sleep 1
64 ${0} start
65 ;;
66
67 status)
68 for daemon in ${DAEMONS}; do
69 statusproc "/usr/sbin/${daemon}"
70 done
71 ;;
72
73 *)
74 echo "Usage: ${0} {start|stop|reload|restart|status}"
75 exit 1
76 ;;
77esac