#!/bin/sh if [ ! -e /etc/linksysconf ] then # Ok this may be a little hack for now # but Make sure the kernel module info is updated # So the driver can actually load the first time /usr/sbin/update-modules dd if=/dev/mtdblock1 of=/etc/linksysconf cat < /etc/interfaces # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # The loopback interface auto lo iface lo inet loopback auto eth0 iface eth0 inet static EOF strings /etc/linksysconf | grep ip_addr >> /etc/interfaces strings /etc/linksysconf | grep ^netmask >> /etc/interfaces strings /etc/linksysconf | grep hw_addr >> /etc/interfaces sed -i -e 's/ip_addr=/ address /' /etc/interfaces sed -i -e 's/netmask=/ netmask /' /etc/interfaces sed -i -e 's/hw_addr=/ hwaddress ether /' /etc/interfaces mv /etc/network/interfaces /etc/network/interfaces.old cp /etc/interfaces /etc/network/interfaces # mv /etc/interfaces /etc/network/interfaces echo "Configured /etc/network/interfaces with IP Static linksysconf Information" fi # Module loading handled more properly by update-modules and modprobe.conf