From: Philippe Seewer Date: Tue, 16 Jun 2009 10:14:02 +0000 (+0200) Subject: write-ifcfg: Save static ip configuration X-Git-Tag: 0.1~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=447f044e8bec4df374fa43494b1c8b6644a5b027;p=thirdparty%2Fdracut.git write-ifcfg: Save static ip configuration Saveing ip= options in ifup makes the information available for later use. This solves the problem how to write static ip configuration in ifcfg files. --- diff --git a/modules.d/40network/write-ifcfg.sh b/modules.d/40network/write-ifcfg.sh index 2a88b3bea..e5f25d57b 100755 --- a/modules.d/40network/write-ifcfg.sh +++ b/modules.d/40network/write-ifcfg.sh @@ -15,10 +15,9 @@ if [ -f /tmp/net.$netif.lease ]; then echo "BOOTPROTO=dhcp" >> /tmp/net.$netif.ifcfg else echo "BOOTPROTO=none" >> /tmp/net.$netif.ifcfg - # Static: XXX Implement me! - #IPADDR=172.16.101.1 - #NETMASK=255.255.255.0 - #DNS1=1.2.3.4 - #DNS2=1.2.3.5 - #GATEWAY=172.16.101.254 + # If we've booted with static ip= lines, the override file is there + . /tmp/net.$netif.override + echo "IPADDR=$ip" >> /tmp/net.$netif.ifcfg + echo "NETMASK=$mask" >> /tmp/net.$netif.ifcfg + [ -n "$gw" ] && echo "GATEWAY=$gw" >> /tmp/net.$netif.ifcfg fi