Added hostname and dns server support to openslug sysconfsetup
authorRod Whitby <rod@whitby.id.au>
Sat, 26 Feb 2005 11:58:48 +0000 (11:58 +0000)
committerRod Whitby <rod@whitby.id.au>
Sat, 26 Feb 2005 11:58:48 +0000 (11:58 +0000)
BKrev: 42206478aR6xQ_4e27X_b_GO_natVQ

packages/openslug-init/openslug-init-0.10/sysconfsetup
packages/openslug-init/openslug-init_0.10.bb

index 3165db9..5c9723b 100644 (file)
@@ -19,34 +19,42 @@ auto eth0
 iface eth0 inet static
 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 hw_addr >> /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/hw_addr=/        hwaddress ether /' /etc/interfaces
    sed -i -e 's/gateway=/        gateway /' /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
+   echo "Configured /etc/network/interfaces from /etc/linksysconf"
 
-exit 0
+   strings /etc/linksysconf | grep disk_server_name >> /tmp/hostname
+   sed -i -e 's/disk_server_name=//' /tmp/hostname
 
-# Future stuff ....
+   if [ -s /tmp/hostname ] ; then
+       mv /etc/hostname /etc/hostname.old
+       mv /tmp/hostname /etc/hostname
+       echo "Configured /etc/hostname from /etc/linksysconf"
+   fi
 
-# Use the bootproto key to set "static" or "dhcp", then do other stuff based on that.
-   strings /etc/linksysconf | grep bootproto >> /etc/interfaces
-   strings /etc/linksysconf | grep disk_server_name >> /etc/interfaces
-   strings /etc/linksysconf | grep hw_addr >> /etc/interfaces
-   strings /etc/linksysconf | grep dns_server1 >> /etc/interfaces
-   sed -i -e 's/bootproto=//' /etc/interfaces
-   sed -i -e 's/disk_server_name=/        hostname /' /etc/interfaces
-   sed -i -e          's/hw_addr=/        hwaddress ether /' /etc/interfaces
-   sed -i -e      's/dns_server1=/         /' /etc/interfaces
+   strings /etc/linksysconf | grep dns_server1 >> /tmp/resolv.conf
+   sed -i -e 's/dns_server1=/nameserver /' /tmp/resolv.conf
+
+   if [ -s /tmp/resolv.conf ] ; then
+       mv /etc/resolv.conf /etc/resolv.conf.old
+       mv /tmp/resolv.conf /etc/resolv.conf
+       echo "Configured /etc/resolv.conf from /etc/linksysconf"
+   fi
 
+fi
+
+# Module loading handled more properly by update-modules and modprobe.conf
index 6b076c7..5c7a8e8 100644 (file)
@@ -2,7 +2,7 @@ DESCRIPTION = "Openslug initial network config via sysconf"
 SECTION = "console/network"
 LICENSE = "GPL"
 DEPENDS = "base-files"
-PR = "r10"
+PR = "r11"
 
 OPENSLUG_VERSION = "1.3-alpha"