diff options
Diffstat (limited to 'initrd/initrd-stuff/bin/dhcpmkconfig')
| -rwxr-xr-x | initrd/initrd-stuff/bin/dhcpmkconfig | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig new file mode 100755 index 00000000..a7cbda19 --- /dev/null +++ b/initrd/initrd-stuff/bin/dhcpmkconfig @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Description: universal (distro independent) configuration writer for +# several dhcp clients +# +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 07-01-2006 +# Blabla +# Blub +# +# Copyright: (c) 2006 - RZ Universitaet Freiburg + +# functions common for all distros +. /etc/functions + +# client variable should be exported via calling function +echo -e "\n# ip configuration written by $0" \ + >>/etc/machine-setup +case $client in + dhcpcd) + cat /var/lib/dhcp/dhcpcd-eth0.info | sed -e "s,',\",g" \ + -e "s,IPADDR,clientip," -e "s,NETMASK,subnet_mask," \ + -e "s,GATEWAY,gateway," -e "s,BROADCAST,broadcast_address," \ + -e "s,HOSTNAME,host_name," -e "s,DOMAIN,domain_name," \ + -e "s,ROOTPATH,root_path," -e "s,DNS,domain_name_servers," \ + -e "s,NTPSERVERS,ntp_servers," -e "s,DHCPSID,serverip," \ + -e "s,WINSSERVERS,netbios_name_servers," \ + -e "s,NETWORK,network," \ + -e "s,DHCP..ADDR.*,," -e "s,.*TIME=.*,," -e "s,CL.*,," \ + -e "s,INTER.*,," -e "s,DHCPSNAME.*,," \ + >>/etc/machine-setup + # empty lines should be removed somehow + ;; + dhclient) + set | grep "new_" | sed \ + -e "s,^new_,," -e "s,fixed-address,clientip," \ + -e "s,routers,gateway," -e "s,dhcp-server-identifier,serverip," \ + -e "s,.*-time.*,," -e "s,language=,country=," \ + >>/etc/machine-setup + ;; +esac + |
