/usr/sbin/update-modules
dd if=/dev/mtdblock1 of=/etc/linksysconf
- cat <<EOF > /etc/interfaces
+ cat <<EOF > /etc/original-network-settings
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
EOF
# Use the bootproto key to set "static" or "dhcp", then do other stuff based on that.
- # strings /etc/linksysconf | grep bootproto >> /etc/interfaces
- # sed -i -e 's/bootproto=//' /etc/interfaces
-
- strings /etc/linksysconf | grep ip_addr >> /etc/interfaces
- strings /etc/linksysconf | grep ^netmask >> /etc/interfaces
- strings /etc/linksysconf | grep gateway >> /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/gateway=/ gateway /' /etc/interfaces
- sed -i -e 's/hw_addr=/ hwaddress ether /' /etc/interfaces
+ # strings /etc/linksysconf | grep bootproto >> /etc/original-network-settings
+ # sed -i -e 's/bootproto=//' /etc/original-network-settings
+
+ strings /etc/linksysconf | grep ip_addr >> /etc/original-network-settings
+ strings /etc/linksysconf | grep ^netmask >> /etc/original-network-settings
+ strings /etc/linksysconf | grep gateway >> /etc/original-network-settings
+ strings /etc/linksysconf | grep hw_addr >> /etc/original-network-settings
+ sed -i -e 's/ip_addr=/ address /' /etc/original-network-settings
+ sed -i -e 's/netmask=/ netmask /' /etc/original-network-settings
+ sed -i -e 's/gateway=/ gateway /' /etc/original-network-settings
+ sed -i -e 's/hw_addr=/ hwaddress ether /' /etc/original-network-settings
mv /etc/network/interfaces /etc/network/interfaces.old
- cp /etc/interfaces /etc/network/interfaces
+ cp /etc/original-network-settings /etc/network/interfaces
echo "Configured /etc/network/interfaces from /etc/linksysconf"