summaryrefslogtreecommitdiff
path: root/templates/firewall/ipv6-receive-redirects
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2009-09-22 15:52:31 -0700
committerBob Gilligan <gilligan@vyatta.com>2009-09-22 15:52:31 -0700
commit4a71e47b4e79daff824546b539612b8747569856 (patch)
tree999686214eef9f2001b88b9afe74ea38331bf45e /templates/firewall/ipv6-receive-redirects
parentacecb392ff2bf3b6e6bf46f699c4b63bbe013b91 (diff)
downloadvyatta-cfg-firewall-4a71e47b4e79daff824546b539612b8747569856.tar.gz
vyatta-cfg-firewall-4a71e47b4e79daff824546b539612b8747569856.zip
Bugfix 4951: Don't fail if IPv6 kernel module is not loaded.
Handle the case where the IPv6 kernel module is not loaded more gracefully.
Diffstat (limited to 'templates/firewall/ipv6-receive-redirects')
-rw-r--r--templates/firewall/ipv6-receive-redirects/node.def42
1 files changed, 23 insertions, 19 deletions
diff --git a/templates/firewall/ipv6-receive-redirects/node.def b/templates/firewall/ipv6-receive-redirects/node.def
index 5ca9e49..a7bd2c8 100644
--- a/templates/firewall/ipv6-receive-redirects/node.def
+++ b/templates/firewall/ipv6-receive-redirects/node.def
@@ -15,26 +15,30 @@ default: "disable"
syntax:expression: $VAR(@) in "enable", "disable"; "icmpv6-receive-redirects must be enable or disable"
update:
- array=(`ls /proc/sys/net/ipv6/conf/`)
- array_len=${#array[*]}
- i=0
- while [ $i -lt $array_len ]; do
- if [ x$VAR(@) == xenable ]; then
- sudo sh -c "echo 1 > \
- /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_redirects"
- else
- sudo sh -c "echo 0 > \
- /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_redirects"
- fi
- let i++
- done
-
-delete:
+ if [ -d /proc/sys/net/ipv6 ]; then
array=(`ls /proc/sys/net/ipv6/conf/`)
array_len=${#array[*]}
- i=0
+ i=0
+ while [ $i -lt $array_len ]; do
+ if [ x$VAR(@) == xenable ]; then
+ sudo sh -c "echo 1 > \
+ /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_redirects"
+ else
+ sudo sh -c "echo 0 > \
+ /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_redirects"
+ fi
+ let i++
+ done
+ fi
+
+delete:
+ if [ -d /proc/sys/net/ipv6 ]; then
+ array=(`ls /proc/sys/net/ipv6/conf/`)
+ array_len=${#array[*]}
+ i=0
while [ $i -lt $array_len ]; do
- sudo sh -c "echo 0 > \
- /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_redirects"
- let i++
+ sudo sh -c "echo 0 > \
+ /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_redirects"
+ let i++
done
+ fi