Listing 1. Filesystem Mounting, Network and Web Server Initialization Script

#!/bin/ash
/bin/mount -a

# Do the networking stuff
echo "Configuring Network"
/sbin/insmod 8390
/sbin/insmod ne io=0x300

if [ -f /var/etc/network ]
then
   . /var/etc/network
else
   NETWORK_IP=192.168.1.2
   NETWORK_MASK=255.255.255.0
   NETWORK_BROADCAST=192.168.1.255
   NETWORK_GATEWAY=192.168.1.254
fi

/sbin/ifconfig eth0 $NETWORK_IP netmask $NETWORK_MASK

/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0


/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
/sbin/route add default gw $NETWORK_GATEWAY

# Do the web server stuff
echo "Starting web server"
/sbin/thttpd -C /etc/thttpd.conf -c "/cgi-bin/*"