summaryrefslogblamecommitdiffstats
path: root/initramfs/stage3-stuff/bin/dhcpmkconfig
blob: dd4b704aa97b7d6f6b153d2aad2cfec514e4705a (plain) (tree)





























                                                                            

                                                                  
#!/bin/ash
# Copyright (c) 2003..2006 - RZ Uni Freiburg
# Copyright (c) 2006..2008 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your feedback to feedback@openslx.org
#
# General information about OpenSLX can be found under http://openslx.org
#
# Universal (distro independent) IP configuration writer for busybox udhcpc 
# applet used within OpenSLX initramfs. The result is written to the 
# /etc/initramfs-setup file

# heavy debugging output in level 3 and above ... and on 13
#FIXME: DEBUGLEVEL is not propagated to this file (at least for Ubuntu)
[ -z "$DEBUGLEVEL" ] && DEBUGLEVEL=0
[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 13 ] && \
  set -x

echo -e "# network configuration written by $0:" >/tmp/confviadhcp
unset infomsg HOME IFS mask lease interface cfgmsg cfgfile DEBUGLEVEL
set | sed \
  -e "s,^P.*,,;s,ntpsrv,ntp_servers,;s,ip,clientip," \
  -e "s,serverid,serverip,;s,subnet,subnet_mask," \
  -e "s,router,gateway,;s,hostname,host_name," \
  -e "s,domain,domain_name,;s,dns,domain_name_servers," \
  -e "s,broadcast,broadcast_address,;s,dhc.*,,;/^$/d" \
  -e "s,nissrv,nis_servers,;s,nisdomain_name,nis_domain," \
  -e "s,wins,netbios_name_servers,;/OPTIND.*/d" >>/tmp/confviadhcp