diff options
author | Daniil Baturin <daniil@vyos.io> | 2020-05-28 18:25:45 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 18:25:45 +0700 |
commit | 82240162ec5d4d9dc8688d6c89f955fd84b27aae (patch) | |
tree | 01a25792de99c50fc2ff27cc17f48022694553cd | |
parent | a7c1adbf93e6464f874a80eafe3515380c149d48 (diff) | |
parent | b24432ac81ab582b252e4ea3fc0d7d0ba6f4580f (diff) | |
download | vyatta-cfg-quagga-82240162ec5d4d9dc8688d6c89f955fd84b27aae.tar.gz vyatta-cfg-quagga-82240162ec5d4d9dc8688d6c89f955fd84b27aae.zip |
Merge pull request #48 from DmitriyEshenko/fix-crux-002
link-detect: T2517: Check if link_filter file exist
-rwxr-xr-x | scripts/vyatta-link-detect | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/vyatta-link-detect b/scripts/vyatta-link-detect index ff3886e2..aecc0cb2 100755 --- a/scripts/vyatta-link-detect +++ b/scripts/vyatta-link-detect @@ -18,18 +18,20 @@ fi # 1 - ignore receive if admin_down # 2 - ignore receive if admin_down or link down set-sysctl () { - sudo sh -c "echo $2 >/proc/sys/net/ipv4/conf/$1/link_filter" + if [ -f /proc/sys/net/ipv4/conf/$1/link_filter ]; then + sudo sh -c "echo $2 >/proc/sys/net/ipv4/conf/$1/link_filter" + fi # sudo sh -c "echo $2 >/proc/sys/net/ipv6/conf/$1/link_filter" } case $2 in on) set-sysctl $1 2 - if [ -f /usr/sbin/zebra ]; then + if [ -f /usr/lib/frr/zebra ]; then exec vtysh -c "configure terminal" -c "interface $1" \ - -c "link-detect" + -c "link-detect" fi ;; off) set-sysctl $1 1 - if [ -f /usr/sbin/zebra ]; then + if [ -f /usr/lib/frr/zebra ]; then exec vtysh -c "configure terminal" -c "interface $1" \ -c "no link-detect" fi ;; |