diff options
author | Jan Engelhardt <jengelh@inai.de> | 2018-06-27 11:50:39 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-07-02 18:07:03 +0200 |
commit | 72d973059efc3637cfe8f6473ec214c8c15206dc (patch) | |
tree | ef5c58891da66b67a6547211cf371704b3034b6c /ebtables-save | |
parent | 48cff25dfea5b37e16ba5dc6601e98ab140f5f99 (diff) |
build: rename sed source files to .in
Prepare for autoconf-based substitution of macros in the file.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'ebtables-save')
-rw-r--r-- | ebtables-save | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/ebtables-save b/ebtables-save deleted file mode 100644 index 49d733b..0000000 --- a/ebtables-save +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl -w -# -# -# A script that generates text output of the ebtables rules. -# Similar to iptables-save. -# -# It can be used to store active configuration to /etc/sysconfig/ebtables - -use strict; -my $table; -my $ebtables = "__EXEC_PATH__/ebtables"; -my $cnt = ""; -my $version = "1.0"; -my $table_name; - -# ======================================================== -# Process filter table -# ======================================================== -sub process_table { - my $chain = ""; - my $rules = ""; - my $chains = ""; - my $line = ""; - - foreach $line (split("\n",$_[0])) { - if ($line =~ m/Bridge table: (.*)/) { - print "*$1\n"; - next; - } - if ($line =~ m/Bridge chain: (.*?), entries:.* policy: (.*)/) { - $chains = $chains . ":$1 $2\n"; - $chain = $1; - next; - } - if ($line =~ m/^$/) { - next; - } - if ($cnt eq "--Lc") { - $line =~ s/, pcnt = (.*) -- bcnt = (.*)/-c $1 $2/; - } else { - $line =~ s/ $//; - } - $rules = $rules . "-A $chain $line\n"; - } - - print $chains; - print $rules; - print "\n"; -} -# ======================================================== - -unless (-x $ebtables) { exit -1 }; -print "# Generated by ebtables-save v$version on " . `date`; -if (defined($ENV{'EBTABLES_SAVE_COUNTER'}) && $ENV{'EBTABLES_SAVE_COUNTER'} eq "yes") { - $cnt = "--Lc"; -} -foreach $table_name (split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`)) { - $table =`$ebtables -t $table_name -L $cnt`; - unless ($? == 0) { print $table; exit -1 }; - &process_table($table); -} |