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

network.sh: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Apr 21 10:17:44 2008 +0000 (2008-04-21)
parents f1529c400e81
children d0ddd8be99c4
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 echo "nameserver $DNS_SERVER" > /etc/resolv.conf
31 fi
33 # For wifi (experimental).
34 if [ "$WIFI" = "yes" ] || grep -q "wifi" /proc/cmdline; then
35 iwconfig $WIFI_INTERFACE essid $ESSID
36 echo "Starting udhcpc client on: $INTERFACE... "
37 /sbin/udhcpc -b -i $WIFI_INTERFACE \
38 -p /var/run/udhcpc.$WIFI_INTERFACE.pid
39 fi