Update to 2022-09-22 16:00

This commit is contained in:
Daniel Berteaud
2022-09-22 16:00:09 +02:00
parent 8b40e52ebe
commit 529151748a
4 changed files with 58 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env perl
use warnings;
use strict;
my $ipt = $ARGV[0];
open(IPT, '<', $ipt) or die "Couldn't open $ipt\n";
my @rules = ();
my $change = 0;
while (<IPT>){
chomp;
if (
(m/(^:|.*\-[Aj]\s+)(CNI|NOMAD\-(?!ADMIN)|DOCKER).*/) or
(m/.*-A\s+NOMAD\-ADMIN/ and not m/\-\-comment\s+"ansible/) or
(m/.*\-o\s+docker0.*/)
){
$change = 1;
next;
}
push @rules, $_;
}
close IPT;
if ($change){
open(IPT, '>', $ipt) or die "Couldn't open $ipt\n";
print IPT join("\n", @rules);
close IPT;
}