Commit b35b39a2 authored by Robert Ricci's avatar Robert Ricci

Exit with non-zero status if the hosts file doesn't use the naming

convention the script expects.
parent 0e5ebf89
......@@ -19,12 +19,21 @@ while (<HOSTS>) {
}
}
my $lines_output = 0;
foreach my $elabnode (keys %elabips) {
my $plabnode = $elabnode;
$plabnode =~ s/elab/planet/i;
if (exists $plabips{$plabnode}) {
print "$elabips{$elabnode} $plabips{$plabnode} elabc-$elabnode\n";
$lines_output++;
}
}
close HOSTS;
if ($lines_output == 0) {
warn "Hosts file had no names I recognize\n";
exit 1;
}
exit 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment