Skip to content

Instantly share code, notes, and snippets.

@flaviolopes
Created August 6, 2010 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flaviolopes/511883 to your computer and use it in GitHub Desktop.
Save flaviolopes/511883 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use 5.12.0;
use File::Util;
my @lista = (
"DEVICE=eth0,100Mbit,10Mbit", "RATE=64Kbit", "WEIGHT=6Kbit", "PRIO=5",
undef, "BOUNDED=yes", "ISOLATED=yes"
);
for ( my $i = 1 ; $i <= 5 ; $i++ ) {
my $rule = "RULE=192.168.1.$i/32";
$lista[4] = $rule;
foreach my $lista (@lista) {
my ($f) = File::Util->new();
$f->write_file(
'file' => "cbq-000$i.estacao$i-in",
'mode' => 'append',
'content' => "$lista\n"
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment