Handle hostnames with upper-case letters
[webmin.git] / net / rc.inet1
1 #! /bin/sh
2 #
3 # rc.inet1      This shell script boots up the base INET system.
4 #
5 # Version:      @(#)/etc/rc.d/rc.inet1  1.01    05/27/93
6 #
7
8 HOSTNAME=`cat /etc/HOSTNAME`
9
10 # Attach the loopback device.
11 /sbin/ifconfig lo 127.0.0.1
12 /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
13
14 # IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the 
15 # eth0 interface. If you're only using loopback or SLIP, don't include the
16 # rest of the lines in this file.
17
18 # Edit for your setup.
19 IPADDR="10.2.6.2"       # REPLACE with YOUR IP address!
20 NETMASK="255.255.0.0"   # REPLACE with YOUR netmask!
21 NETWORK="10.2.0.0"      # REPLACE with YOUR network address!
22 BROADCAST="10.2.255.255"        # REPLACE with YOUR broadcast address, if you
23                         # have one. If not, leave blank and edit below.
24 GATEWAY="10.2.5.111"    # REPLACE with YOUR gateway address!
25
26 # Uncomment the line below to configure your ethernet card.
27 /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
28
29 # If the line above is uncommented, the code below can also be uncommented.
30 # It sees if the ethernet was properly initialized, and gives the admin some
31 # hints about what to do if it wasn't.
32 if [ ! $? = 0 ]; then
33   cat << END
34 Your ethernet card was not initialized properly.  Here are some reasons why this
35 may have happened, and the solutions:
36 1. Your kernel does not contain support for your card.  Including all the 
37    network drivers in a Linux kernel can make it too large to even boot, and
38    sometimes including extra drivers can cause system hangs.  To support your
39    ethernet, either edit /etc/rc.d/rc.modules to load the support at boottime,
40    or compile and install a kernel that contains support.
41 2. You don't have an ethernet card, in which case you should comment out this
42    section of /etc/rc.d/rc.inet1.  (Unless you don't mind seeing this error...)
43 END
44
45 fi
46
47 # Uncomment this to set up your gateway route:
48 if [ ! "$GATEWAY" = "" ]; then
49  /sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
50 fi
51
52 # End of rc.inet1