diff options
author | Christian Poessinger <christian@poessinger.com> | 2017-08-30 15:03:49 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2017-08-30 15:03:49 +0200 |
commit | d03a0ff45853a5e06897dfa1f07a0ec15aa9e9c2 (patch) | |
tree | 91f98b109ca5bf06858774871b6a4a48fac6737c /interface-templates | |
parent | 371a82ff2a351f33188e3dec7fabb6d3dbb5ffb0 (diff) | |
download | vyatta-cfg-quagga-d03a0ff45853a5e06897dfa1f07a0ec15aa9e9c2.tar.gz vyatta-cfg-quagga-d03a0ff45853a5e06897dfa1f07a0ec15aa9e9c2.zip |
Probe for interface existance
This fixes T345. Most of the "interface" command nodes probe if the actual
interface exists before applying any setting to it.
Diffstat (limited to 'interface-templates')
-rw-r--r-- | interface-templates/ip/source-validation/node.def | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/interface-templates/ip/source-validation/node.def b/interface-templates/ip/source-validation/node.def index 036bf0c2..64d13ea8 100644 --- a/interface-templates/ip/source-validation/node.def +++ b/interface-templates/ip/source-validation/node.def @@ -33,8 +33,12 @@ update: fi echo "Global value is $global" fi - sudo sh -c "echo $new > \ - /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + if [ -d /sys/class/net/$VAR(../@) ] ; then + sudo sh -c "echo $new > \ + /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + fi delete: - sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + if [ -d /sys/class/net/$VAR(../@) ] ; then + sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + fi |