+sub verify_run {
+ open(PATCHLIST, $patchlist) or die "Unable to open patchlist";
+ while (<PATCHLIST>) {
+ print "Verify run....\n";
+ my ($switch, $distro, $port) = split;
+
+ if ($switch eq "e71-6") {
+ print "There is no e71-6\n";
+ next;
+ }
+
+ my ($row, $place, $ipnet, $vlan, $ip, $dip) = switch_info($switch, $distro, $port);
+ print "Switch: $switch, Distro: $distro, vlan: $vlan\n";
+ print "Ip net: $ipnet\n";
+ print "Ip: $ip\n";
+
+ my $p = Net::Ping->new();
+ printf "Checking if zyxel is up $dip:$vlan $ip...\n";
+ my $counter = 0;
+ while (1) {
+ if ($counter > 4) {
+ print "No answer from $dip:$vlan $ip, trying to route it up\n";
+ my $ret = do_distro($dip, $ip, $vlan, $switch);
+ if ($ret == 0) {
+ # No answer from zyxel
+ last;
+ }
+ print "Waiting for telnet to time out so we can do run ciscong.pl\n";
+ sleep 100;
+ system("perl ./ciscong2.pl $switch");
+ last;
+ }
+ last if $p->ping($ip);
+ print "pinging...\n";
+ sleep 1;
+ $counter++;
+ }
+
+# my ($dip, $newip, $vlan) = @_;
+ }
+ close(PATCHLIST);
+}
+