summaryrefslogtreecommitdiff
path: root/interface-templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2017-08-30 15:03:49 +0200
committerChristian Poessinger <christian@poessinger.com>2017-08-30 15:03:49 +0200
commitd03a0ff45853a5e06897dfa1f07a0ec15aa9e9c2 (patch)
tree91f98b109ca5bf06858774871b6a4a48fac6737c /interface-templates
parent371a82ff2a351f33188e3dec7fabb6d3dbb5ffb0 (diff)
downloadvyatta-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.def10
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