aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2007-04-16 23:32:46 +0000
committerBill Nottingham <notting@redhat.com>2007-04-16 23:32:46 +0000
commit94906dfa88fabcbb9956bb9cb8c95aba0d7101c5 (patch)
tree5cfce76fc01146ad1d800c50060097954695643c /sysconfig
parentef30f95eb94be2017bc10ba69c77b3bf7929ac8e (diff)
downloadinitscripts-94906dfa88fabcbb9956bb9cb8c95aba0d7101c5.tar
initscripts-94906dfa88fabcbb9956bb9cb8c95aba0d7101c5.tar.gz
initscripts-94906dfa88fabcbb9956bb9cb8c95aba0d7101c5.tar.bz2
initscripts-94906dfa88fabcbb9956bb9cb8c95aba0d7101c5.tar.xz
initscripts-94906dfa88fabcbb9956bb9cb8c95aba0d7101c5.zip
cleanup & optimize sysctl usage (#217595)
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/init.ipv6-global11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/init.ipv6-global b/sysconfig/network-scripts/init.ipv6-global
index 65897b21..40dcdc27 100755
--- a/sysconfig/network-scripts/init.ipv6-global
+++ b/sysconfig/network-scripts/init.ipv6-global
@@ -64,7 +64,8 @@ case $ACTION in
fi
# Reset IPv6 sysctl switches for "all", "default" and still existing devices
- sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort -u | while read interface; do
+ for i in /proc/sys/net/ipv6/conf/* ; do
+ interface=${i##*/}
# Host/Router behaviour for the interface
ipv6_exec_sysctl -w net.ipv6.conf.$interface.forwarding=$ipv6_global_forwarding >/dev/null 2>&1
@@ -133,7 +134,8 @@ case $ACTION in
ipv6_test testonly || exit 0
- sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort -u | while read interface; do
+ for i in /proc/sys/net/ipv6/conf/* ; do
+ interface=${i##*/}
# Assume Host behaviour
ipv6_exec_sysctl -w net.ipv6.conf.$interface.forwarding=0 >/dev/null 2>&1
@@ -165,8 +167,9 @@ case $ACTION in
ipv6_test testonly || exit 0
# Show sysctl switches
- sysctl -a | grep "^net\.ipv6\.conf\.default\." | awk -F. '{ print $5 }' | awk -F= '{ print $1 }' | sed 's/ //g' | while read switch; do
- sysctl -a | grep "^net\.ipv6\.conf\." | awk -F. '{ print $4 }' | sort -u | while read interface; do
+ sysctl net.ipv6.conf.default |awk -F '.' '{ print gensub(" =.*","","G",$5) }' | while read switch; do
+ for i in /proc/sys/net/ipv6/conf/* ; do
+ interface=${i##*/}
sysctl net.ipv6.conf.$interface.$switch
done
echo