slitaz-boot-scripts diff etc/init.d/network.sh @ rev 67

Add wifi config and boot option (experimental)
author Christophe Lincoln <pankso@slitaz.org>
date Fri Apr 18 11:32:24 2008 +0200 (2008-04-18)
parents e860c8bd2c57
children 1e93fd1b1640
line diff
     1.1 --- a/etc/init.d/network.sh	Fri Nov 30 12:34:07 2007 +0100
     1.2 +++ b/etc/init.d/network.sh	Fri Apr 18 11:32:24 2008 +0200
     1.3 @@ -18,15 +18,22 @@
     1.4  
     1.5  # For a dynamic IP with DHCP.
     1.6  if [ "$DHCP" = "yes" ] ; then
     1.7 -  echo "Starting udhcpc client on: $INTERFACE... "
     1.8 -  /sbin/udhcpc -b -i $INTERFACE -p /var/run/udhcpc.$INTERFACE.pid
     1.9 +	echo "Starting udhcpc client on: $INTERFACE... "
    1.10 +	/sbin/udhcpc -b -i $INTERFACE -p /var/run/udhcpc.$INTERFACE.pid
    1.11  fi
    1.12  
    1.13  # For a static IP.
    1.14  if [ "$STATIC" = "yes" ] ; then
    1.15 -  echo "Configuring static IP on $INTERFACE: $IP... "
    1.16 -  /sbin/ifconfig $INTERFACE $IP netmask $NETMASK up
    1.17 -  /sbin/route add default gateway $GATEWAY
    1.18 -  echo "nameserver $DNS_SERVER" > /etc/resolv.conf
    1.19 +	echo "Configuring static IP on $INTERFACE: $IP... "
    1.20 +	/sbin/ifconfig $INTERFACE $IP netmask $NETMASK up
    1.21 +	/sbin/route add default gateway $GATEWAY
    1.22 +	echo "nameserver $DNS_SERVER" > /etc/resolv.conf
    1.23  fi
    1.24  
    1.25 +# For wifi (experimental).
    1.26 +if [ "$WIFI" = "yes" -o grep -q "wifi" /proc/cmdline ] ; then
    1.27 +	iwconfig $WIFI_INTERFACE essid $ESSID
    1.28 +	echo "Starting udhcpc client on: $INTERFACE... "
    1.29 +	/sbin/udhcpc -b -i $WIFI_INTERFACE \
    1.30 +		-p /var/run/udhcpc.$WIFI_INTERFACE.pid
    1.31 +fi