diff options
Diffstat (limited to 'interface-templates/ip')
-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 |