use Data::Dumper;
-my $patchlist = "/root/patchlist.txt";
-my $switches = "/root/switches.txt";
-#my $patchlist = "/home/eirikn/patchlist.txt.eirik";
-#my $switches = "/home/eirikn/switches.txt.eirik";
+#my $patchlist = "/root/patchlist.txt";
+#my $switches = "/root/switches.txt";
+my $patchlist = "/home/eirikn/patchlist.txt.eirik";
+my $switches = "/home/eirikn/switches.txt.eirik";
BEGIN {
require "../include/config.pm";
sub do_distro {
- my ($dip, $newip, $vlan) = @_;
+ my ($dip, $newip, $vlan, $switchname) = @_;
my $ios = Net::Telnet::Cisco->new(Host => $dip,
Errmode => 'return',
print "Zyxel is alive..\n";
$p->close();
- system("perl ./zyxelng.pl 192.168.1.1 $newip");
+ system("perl ./zyxelng.pl 192.168.1.1 $newip $switchname");
####
while(<SWITCHES>) {
my ($ip, $net, $name) = split;
- print $name."\n";
if ($name =~ /e\d+-\d/) {
die "We only support /26 nets for now you wanted $net" if ($net ne "26");
$switchips{$name} = $ip;
print "Ip: $ip\n";
my $dip = $distro.".net.tg07.gathering.org";
- do_distro($dip, $ip, $vlan);
+ do_distro($dip, $ip, $vlan, $switch);
# my ($dip, $newip, $vlan) = @_;
}
close(PATCHLIST);