]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
ifcfg/write-ifcfg.sh: use PREFIX for prefix netmask form
authorHarald Hoyer <harald@redhat.com>
Wed, 9 May 2012 12:58:52 +0000 (14:58 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 9 May 2012 12:58:52 +0000 (14:58 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=820185

modules.d/45ifcfg/write-ifcfg.sh

index f612762dd0cb33fe7ebe411bf93cb12ffc583a4b..580fbd43531a1c67c25282b9febe426ac08a01b4 100755 (executable)
@@ -50,7 +50,11 @@ for netif in $IFACES ; do
         # If we've booted with static ip= lines, the override file is there
             [ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
             echo "IPADDR=$ip"
-            echo "NETMASK=$mask"
+            if strstr "$mask" "."; then
+                echo "NETMASK=$mask"
+            else
+                echo "PREFIX=$mask"
+            fi
             [ -n "$gw" ] && echo "GATEWAY=$gw"
         fi
     } > /tmp/ifcfg/ifcfg-$netif