]> git.proxmox.com Git - mirror_frr.git/commitdiff
tools/frrcommon.sh: ignore 'declare' failures
authorDavid Lamparter <equinox@diac24.net>
Sun, 24 Mar 2019 14:52:02 +0000 (15:52 +0100)
committerDavid Lamparter <equinox@diac24.net>
Sun, 24 Mar 2019 14:53:43 +0000 (15:53 +0100)
The "declare -p watchfrr_options" call is just to support backwards
compatibility.  If it fails, silently ignore that.

Signed-off-by: David Lamparter <equinox@diac24.net>
tools/frrcommon.sh.in

index 76a0d617ba199616d2e158f158fb7e0b56fd0e49..897e6d65587d0b1e8f51e0c532606026109da4e3 100644 (file)
@@ -291,7 +291,7 @@ load_old_config "$C_PATH/daemons.conf"
 load_old_config "/etc/default/frr"
 load_old_config "/etc/sysconfig/frr"
 
-if declare -p watchfrr_options | grep -q '^declare \-a'; then
+if { declare -p watchfrr_options 2>/dev/null || true; } | grep -q '^declare \-a'; then
        log_warning_msg "watchfrr_options contains a bash array value." \
                "The configured value is intentionally ignored since it is likely wrong." \
                "Please remove or fix the setting."