Include per-interface routes in backup
authorJamie Cameron <jcameron@webmin.com>
Sat, 14 Mar 2009 18:58:12 +0000 (18:58 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sat, 14 Mar 2009 18:58:12 +0000 (18:58 +0000)
net/redhat-linux-lib.pl

index aaa2d9f..c41b9bb 100644 (file)
@@ -268,15 +268,16 @@ if (!$supports_dev_routes) {
        push(@rv, $static_route_config);
        }
 else {
-       local $f;
-       opendir(DIR, &translate_filename($devices_dir));
-       while($f = readdir(DIR)) {
-               if ($f =~ /^([a-z]+\d*(\.\d+)?(:\d+)?)\.route$/ ||
-                   $f =~ /^route\-([a-z]+\d*(\.\d+)?(:\d+)?)$/) {
-                       push(@rv, "$devices_dir/$f");
+       foreach my $dir ($devices_dir, $net_scripts_dir) {
+               opendir(DIR, &translate_filename($dir));
+               while(my $f = readdir(DIR)) {
+                       if ($f =~ /^([a-z]+\d*(\.\d+)?(:\d+)?)\.route$/ ||
+                           $f =~ /^route\-([a-z]+\d*(\.\d+)?(:\d+)?)$/) {
+                               push(@rv, "$dir/$f");
+                               }
                        }
+               closedir(DIR);
                }
-       closedir(DIR);
        }
 return @rv;
 }