wok-6.x rev 20070

busybox/udhcpc6: update script (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Sep 23 17:56:48 2017 +0200 (2017-09-23)
parents 265e84f3feb6
children e03da3e76528
files busybox/stuff/udhcp.script
line diff
     1.1 --- a/busybox/stuff/udhcp.script	Sat Sep 23 17:21:58 2017 +0200
     1.2 +++ b/busybox/stuff/udhcp.script	Sat Sep 23 17:56:48 2017 +0200
     1.3 @@ -15,10 +15,12 @@
     1.4  	grep -qe '\(:.* /\|httpfs\|nfs\|smbfs\|ncp\|coda\)' /proc/mounts
     1.5  }
     1.6  
     1.7 -logger "$0 interface=$interface ip=$ip ipv6=$ipv6 broadcast=$broadcast subnet=$subnet ipv6prefix=$ipv6prefix router=$router domain=$domain dns=$dns fqdn=$fqdn $@"
     1.8 +logger "$0 interface=$interface ip=$ip ipv6=$ipv6 broadcast=$broadcast \
     1.9 +subnet=$subnet ipv6prefix=$ipv6prefix router=$router domain=$domain dns=$dns \
    1.10 +fqdn=$fqdn mask=$mask lease=$lease tz=$tz tz_name=$tz_name sname=$sname $@"
    1.11  
    1.12  skip="$(sed "/skipdhcpip=/!d;s/.*skipdhcpip=\([^ ]*\).*/\1/" </proc/cmdline)"
    1.13 -case " $skip " in *\ ${ip:-$ipv6}\ *) exit 0;; esac
    1.14 +case ",${skip:-X}," in *,${ip:-$ipv6},*) exit 0;; esac
    1.15  
    1.16  case "$1" in
    1.17  	deconfig)
    1.18 @@ -36,17 +38,18 @@
    1.19  		ip=${ip:-$ipv6}
    1.20  		if [ ${ip/:/} == $ip ]; then
    1.21  			ifconfig $interface $ip $BROADCAST $NETMASK
    1.22 +			v6=""
    1.23  		else
    1.24  			ip -6 addr add $ip/${ipv6mask:-64} $DEV
    1.25 +			v6="-A inet6"
    1.26  		fi
    1.27  
    1.28  		if [ -n "$router" ] ; then
    1.29  			while route del default gw 0.0.0.0 $DEV ; do :; done
    1.30 -			t=
    1.31 -			[ ${ip/:/} != $ip ] && t="-A inet6" && ip -6 route flush $DEV
    1.32 -			metric=0
    1.33 +			[ -n "$v6" ] && ip -6 route flush $DEV
    1.34 +			m=0
    1.35  			for i in $router ; do
    1.36 -				route $t add default gw $i $DEV metric $((metric++))
    1.37 +				route $v6 add default gw $i $DEV metric $((m++))
    1.38  			done
    1.39  		fi 2>/dev/null
    1.40