diff options
-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 ;; |