]>
git.proxmox.com Git - mirror_frr.git/blob - debian/frr.preinst
3 # bash is required since /etc/frr/daemons.conf used a bash array in some
6 # NOTE: this code exists specifically to make migrations from Quagga to
7 # FRR easier. FRR is able to load most Quagga configurations, but the
8 # config handling itself has changed with the move towards the "integrated"
9 # /etc/frr/frr.conf approach instead of separate per-daemon config files.
11 # That said, with this in place there's a good chance users can use a
12 # preexisting Quagga config with little hassle.
17 test -f /etc
/frr
/daemons
&& .
/etc
/frr
/daemons
18 test -f /etc
/frr
/daemons.conf
&& .
/etc
/frr
/daemons.conf
19 test -f /etc
/default
/frr
&& .
/etc
/default
/frr
21 if [ "$watchfrr_enable" = no
-o \
22 "$watchfrr_enable" = "0" ]; then
24 ERROR: Pre-existing frr configuration file disables watchfrr.
26 This configuration is deprecated upstream and not supported by the Debian
27 FRR package. Refusing to $1 in order to not break running setups.
28 Please change your setup to use watchfrr and remove the "watchfrr_enable"
29 option from /etc/frr/daemons, /etc/frr/daemons.conf and/or /etc/default/frr.
35 if test -f /etc
/frr
/vtysh.conf
; then
36 if grep -q '^[[:space:]]*service[[:space:]]\+integrated-vtysh-config' /etc
/frr
/vtysh.conf
; then
37 # existing vtysh.conf with integrated statement
38 # - do nothing (=> integrated config)
40 elif grep -q '^[[:space:]]*no[[:space:]]\+service[[:space:]]\+integrated-vtysh-config' /etc
/frr
/vtysh.conf
; then
41 # explicit non-integrated
42 # => need to fix vtysh.conf & frr.conf in postinst
44 if test -f /etc
/frr
/frr.conf
; then
46 ERROR: Pre-existing /etc/frr/vtysh.conf specifies
47 "no service integrated-vtysh-config", but /etc/frr/frr.conf exists. This
48 will cause the frr package to malfunction. Please remove /etc/frr/frr.conf
49 or remove the "no service integrated-vtysh-config" statement from
55 # vtysh.conf exists but has no statement
59 if test -f /etc
/frr
/frr.conf
; then
60 # vtysh.conf has no explicit statement but frr.conf exists
61 # => integrated config used
63 elif test -f /etc
/frr
/zebra.conf \
64 -o -f /etc
/frr
/bgpd.conf \
65 -o -f /etc
/frr
/ospfd.conf \
66 -o -f /etc
/frr
/ospf6d.conf \
67 -o -f /etc
/frr
/ripd.conf \
68 -o -f /etc
/frr
/ripngd.conf \
69 -o -f /etc
/frr
/isisd.conf \
70 -o -f /etc
/frr
/pimd.conf \
71 -o -f /etc
/frr
/ldpd.conf \
72 -o -f /etc
/frr
/nhrpd.conf \
73 -o -f /etc
/frr
/eigrpd.conf \
74 -o -f /etc
/frr
/babeld.conf \
75 -o -f /etc
/frr
/pbrd.conf \
76 -o -f /etc
/frr
/bfdd.conf
; then
77 # no explicit statement, but some split config file exists
78 # => need to fix vtysh.conf & frr.conf in postinst
79 test -n "$vtysh" || vtysh
='ni'
81 # no config at all - use integrated
84 if test "$vtysh" = "ni"; then
85 touch /etc
/frr
/.pkg.frr.nointegrated
89 # shouldn't fail an upgrade abort