summaryrefslogtreecommitdiff
path: root/templates/firewall/ipv6-src-route/node.def
diff options
context:
space:
mode:
Diffstat (limited to 'templates/firewall/ipv6-src-route/node.def')
-rw-r--r--templates/firewall/ipv6-src-route/node.def38
1 files changed, 21 insertions, 17 deletions
diff --git a/templates/firewall/ipv6-src-route/node.def b/templates/firewall/ipv6-src-route/node.def
index be69afe..ec88393 100644
--- a/templates/firewall/ipv6-src-route/node.def
+++ b/templates/firewall/ipv6-src-route/node.def
@@ -1,10 +1,10 @@
-# accept_source_route - INTEGER
+# accept_source_route - Text
# Accept source routing (routing extension header).
#
-# >= 0: Accept only routing header type 2.
-# < 0: Do not accept routing header.
+# enable: Accept only routing header type 2.
+# disable: Do not accept routing header.
#
-# Default: -1
+# Default: disable
type: txt
@@ -20,21 +20,24 @@ default: "disable"
syntax:expression: $VAR(@) in "enable", "disable"; "ipv6-src-route 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 0 > \
- /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_source_route"
- else
- sudo sh -c "echo -1 > \
- /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_source_route"
- fi
- let i++
- done
+ 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
+ if [ x$VAR(@) == xenable ]; then
+ sudo sh -c "echo 0 > \
+ /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_source_route"
+ else
+ sudo sh -c "echo -1 > \
+ /proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_source_route"
+ 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
@@ -43,3 +46,4 @@ delete:
/proc/sys/net/ipv6/conf/${array[$i]%:*}/accept_source_route"
let i++
done
+ fi