diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-09-23 23:11:28 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-09-23 23:11:28 -0700 |
commit | 89aa57e62e4fc60514f9e514d198573fe36427d1 (patch) | |
tree | 492e29ef2f219bbcc2bcec9bac03214f2d2f3e87 /scripts/rl-system.init | |
parent | 063143ab7737442bbc460c5465923f5f7bcd41c3 (diff) | |
parent | 8e984715717650648e968860a7cf0e554445ca50 (diff) | |
download | vyatta-cfg-system-89aa57e62e4fc60514f9e514d198573fe36427d1.tar.gz vyatta-cfg-system-89aa57e62e4fc60514f9e514d198573fe36427d1.zip |
Merge branch 'kenwood' of suva.vyatta.com:/git/vyatta-cfg-system into kenwood
Diffstat (limited to 'scripts/rl-system.init')
-rwxr-xr-x | scripts/rl-system.init | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/scripts/rl-system.init b/scripts/rl-system.init index e05e0564..3ca02ed2 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -135,23 +135,30 @@ create_ssh_host_keys () { set_ipv6_params () { - # default values for ipv6 parameters do not take effect for interfaces at boot - # time, so copy over default values to their interface specific parameter - ipv6_params=(accept_source_route accept_redirects) - num_ipv6_params=${#ipv6_params[*]} - i=0 - while [ $i -lt $num_ipv6_params ]; do - default_val=`cat /proc/sys/net/ipv6/conf/default/${ipv6_params[$i]}` - array=(`ls /proc/sys/net/ipv6/conf/`) - array_len=${#array[*]} - j=0 - while [ $j -lt $array_len ]; do - sudo sh -c "echo $default_val > \ - /proc/sys/net/ipv6/conf/${array[$j]}/${ipv6_params[$i]}" - let j++ - done - let i++ - done + # default values for ipv6 parameters do not take effect for interfaces at + # boot time, so copy over default values to their interface specific + # parameter + + if [ ! -d /proc/sys/net/ipv6 ]; then + # Skip it if IPv6 is not loaded + return + fi + + ipv6_params=(accept_source_route accept_redirects) + num_ipv6_params=${#ipv6_params[*]} + i=0 + while [ $i -lt $num_ipv6_params ]; do + default_val=`cat /proc/sys/net/ipv6/conf/default/${ipv6_params[$i]}` + array=(`ls /proc/sys/net/ipv6/conf/`) + array_len=${#array[*]} + j=0 + while [ $j -lt $array_len ]; do + sudo sh -c "echo $default_val > \ + /proc/sys/net/ipv6/conf/${array[$j]}/${ipv6_params[$i]}" + let j++ + done + let i++ + done } setup_ntp_config_file () { @@ -172,7 +179,7 @@ start () { setup_ntp_config_file add_new_serial_if || \ log_failure_msg "can\'t add serial interfaces" - sysctl -q -p /opt/vyatta/etc/vyatta-sysctl.conf || + sysctl -q -e -p /opt/vyatta/etc/vyatta-sysctl.conf || log_failure_msg "can\'t configure kernel settings" set_ipv6_params update_version_info |