slitaz-boot-scripts rev 403

network.sh: advanced interface stopping on start
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Jul 06 02:06:43 2015 +0300 (2015-07-06)
parents 9a32f6e0607f
children bf6a1b7f0dd0
files etc/init.d/network.sh
line diff
     1.1 --- a/etc/init.d/network.sh	Sun Jul 05 10:49:45 2015 +0200
     1.2 +++ b/etc/init.d/network.sh	Mon Jul 06 02:06:43 2015 +0300
     1.3 @@ -299,7 +299,16 @@
     1.4  
     1.5  
     1.6  start() {
     1.7 -	stop
     1.8 +	# stopping only unspecified interfaces
     1.9 +	interfaces="$(ifconfig | sed -e '/^[^ ]/!d' -e 's|^\([^ ]*\) .*|\1|' -e '/lo/d')"
    1.10 +	case $WIFI in
    1.11 +		# don't stop Wi-Fi Interface if Wi-Fi selected
    1.12 +		yes) interfaces="$(echo "$interfaces" | sed -e "/^$WIFI_INTERFACE$/d")";;
    1.13 +	esac
    1.14 +	for iface in $interfaces; do
    1.15 +		ifconfig $iface down
    1.16 +	done
    1.17 +
    1.18  	eth; wifi
    1.19  	dhcp; static_ip
    1.20  	reconnect_wifi_network