slitaz-boot-scripts view etc/init.d/network.sh @ rev 79

Typo in wifi config message
author Christophe Lincoln <pankso@slitaz.org>
date Mon May 12 17:34:08 2008 +0200 (2008-05-12)
parents d0ddd8be99c4
children 1127ecb2b484
line source
1 #!/bin/sh
2 # /etc/init.d/network.sh - Network initialisation boot script.
3 # Config file is: /etc/network.conf
4 #
5 . /etc/init.d/rc.functions
6 . /etc/network.conf
8 # Set hostname.
9 echo -n "Setting hostname... "
10 /bin/hostname -F /etc/hostname
11 status
13 # Configure loopback interface.
14 echo -n "Configure loopback... "
15 /sbin/ifconfig lo 127.0.0.1 up
16 /sbin/route add 127.0.0.1 lo
17 status
19 # For a dynamic IP with DHCP.
20 if [ "$DHCP" = "yes" ] ; then
21 echo "Starting udhcpc client on: $INTERFACE... "
22 /sbin/udhcpc -b -i $INTERFACE -p /var/run/udhcpc.$INTERFACE.pid
23 fi
25 # For a static IP.
26 if [ "$STATIC" = "yes" ] ; then
27 echo "Configuring static IP on $INTERFACE: $IP... "
28 /sbin/ifconfig $INTERFACE $IP netmask $NETMASK up
29 /sbin/route add default gateway $GATEWAY
30 # Multi-DNS server in $DNS_SERVER.
31 /bin/mv /etc/resolv.conf /tmp/resolv.conf.$$
32 for NS in $DNS_SERVER
33 do
34 echo "nameserver $NS" >> /etc/resolv.conf
35 done
36 fi
38 # For wifi. Users just have to enable it throught yes and usually
39 # essid any will work and interafce is wlan0.
40 if [ "$WIFI" = "yes" ] || grep -q "wifi" /proc/cmdline; then
41 iwconfig $WIFI_INTERFACE essid $ESSID
42 echo "Starting udhcpc client on: $WIFI_INTERFACE... "
43 /sbin/udhcpc -b -i $WIFI_INTERFACE \
44 -p /var/run/udhcpc.$WIFI_INTERFACE.pid
45 fi