detects out of date mgr_port values

This commit is contained in:
Jed Reynolds
2019-11-12 17:40:38 -08:00
parent e9f249d311
commit f42fc97a19

View File

@@ -35,12 +35,16 @@ die ("Unable to parse config.values")
unless ((keys %configv) > 5); unless ((keys %configv) > 5);
die ("no mgt_dev in config.values") die ("no mgt_dev in config.values")
unless defined $configv{'mgt_dev'}; unless defined $configv{'mgt_dev'};
print "Found mgt_dev $configv{'mgt_dev'}\n"; print "LANforge config states mgt_dev $configv{'mgt_dev'}\n";
if ( ! -d "/sys/class/net/$configv{'mgt_dev'}") {
print "Please run lfconfig again with your updated mgt_port value.\n";
exit(1);
}
my $ipline = `ip -o a show $configv{"mgt_dev"}`; my $ipline = `ip -o a show $configv{"mgt_dev"}`;
#print "IPLINE[$ipline]\n"; #print "IPLINE[$ipline]\n";
my ($ip) = $ipline =~ / inet ([0-9.]+)(\/\d+)? /g; my ($ip) = $ipline =~ / inet ([0-9.]+)(\/\d+)? /g;
die ("No ip found for mgt_dev") die ("No ip found for mgt_dev; your config.values file is out of date: $!")
unless ((defined $ip) && ($ip ne "")); unless ((defined $ip) && ($ip ne ""));
print "ip: $ip\n"; print "ip: $ip\n";