Handle interfaces with no DEVICE line
authorJamie Cameron <jcameron@webmin.com>
Thu, 28 Jul 2011 19:37:29 +0000 (12:37 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 28 Jul 2011 19:37:29 +0000 (12:37 -0700)
https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3381110&group_id=17457

net/redhat-linux-lib.pl

index a1212b8..c77f775 100755 (executable)
@@ -81,10 +81,10 @@ while($f = readdir(CONF)) {
                $b->{'file'} = "$net_scripts_dir/$f";
                push(@rv, $b);
                }
-       elsif ($f =~ /^ifcfg-[a-z0-9:\.]+$/ && $f !~ /\.(bak|old)$/i) {
+       elsif ($f !~ /\.(bak|old)$/i || $f =~ /^ifcfg-([a-z0-9:\.]+)$/) {
                # Normal interface
                &read_env_file("$net_scripts_dir/$f", \%conf);
-               $b->{'fullname'} = $conf{'DEVICE'};
+               $b->{'fullname'} = $conf{'DEVICE'} || $1;
                if ($b->{'fullname'} =~ /(\S+):(\d+)/) {
                        $b->{'name'} = $1;
                        $b->{'virtual'} = $2;