summaryrefslogtreecommitdiff
blob: 7cfe128babf44b89f7280bfabc791efaf005c9b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/ebtables-save.in b/ebtables-save.in
index 17924a2..c7a64c3 100644
--- a/ebtables-save.in
+++ b/ebtables-save.in
@@ -12,6 +12,7 @@ my $ebtables = "@sbindir@/ebtables";
 my $cnt = "";
 my $version = "1.0";
 my $table_name;
+my @table_names;
 
 # ========================================================
 # Process filter table
@@ -49,6 +50,13 @@ sub process_table {
 }
 # ========================================================
 
+if ($#ARGV + 1 == 0) {
+   @table_names =split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`);
+}
+else {
+   @table_names = @ARGV;
+}
+# ========================================================
 unless (-x $ebtables) { exit -1 };
 print "# Generated by ebtables-save v$version (legacy) on " . `date`;
 if (defined($ENV{'EBTABLES_SAVE_COUNTER'}) && $ENV{'EBTABLES_SAVE_COUNTER'} eq "yes") {