From: <abe...@us...> - 2017-05-11 15:24:07
|
Revision: 8297 http://sourceforge.net/p/astlinux/code/8297 Author: abelbeck Date: 2017-05-11 15:24:04 +0000 (Thu, 11 May 2017) Log Message: ----------- wide-dhcpv6, dhcp6c.script, minor simplification, no functional change Modified Paths: -------------- branches/1.0/package/wide-dhcpv6/dhcp6c.script Modified: branches/1.0/package/wide-dhcpv6/dhcp6c.script =================================================================== --- branches/1.0/package/wide-dhcpv6/dhcp6c.script 2017-05-10 21:08:19 UTC (rev 8296) +++ branches/1.0/package/wide-dhcpv6/dhcp6c.script 2017-05-11 15:24:04 UTC (rev 8297) @@ -43,7 +43,7 @@ setup_env() { - local conffile pd_1 prefix_len prefix_if first_if interface ipv6 ipv6_ex cut_chars prefix_label IFS + local conffile pd_1 prefix_len prefix_if interface ipv6 ipv6_ex cut_chars prefix_label IFS ## Globals to export dhcp6c_interface="" @@ -67,25 +67,21 @@ prefix_len="$(echo "$pd_1" | sed -n -r -e 's/^ +prefix +::\/([0-9]+) .*$/\1/p')" prefix_if="$(echo "$pd_1" | sed -n -r -e 's/^ +prefix-interface +([^ ]+) .*$/\1/p')" - first_if="" unset IFS for interface in $prefix_if; do dhcp6c_prefix_interfaces="$dhcp6c_prefix_interfaces,$interface" dhcp6c_prefix_addresses="$dhcp6c_prefix_addresses,$(get_ipv6_global_addr $interface)" - if [ -z "$first_if" ]; then - first_if="$interface" - fi done # remove leading comma, this method keeps the pairs comma-aligned dhcp6c_prefix_interfaces="${dhcp6c_prefix_interfaces#,}" dhcp6c_prefix_addresses="${dhcp6c_prefix_addresses#,}" - if [ -z "$first_if" ]; then + if [ -z "$dhcp6c_prefix_addresses" ]; then return fi - ipv6="$(get_ipv6_global_addr $first_if)" + ipv6="$(echo "$dhcp6c_prefix_addresses" | cut -d',' -f1)" if [ -n "$ipv6" ]; then ipv6_ex="$(netcalc "$ipv6" | sed -n -r -e 's/^Expanded IPv6 *: *([0-9a-fA-F:]+).*$/\1/p')" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |