diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-05-09 14:00:59 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-05-14 10:08:15 +0000 |
commit | cc5f5b2b41db293a9ce7ef554adde9e776fd1ad2 (patch) | |
tree | 4afd49f607f3b11f077aa61a8187585dcfa98dbe /vespaclient/src/perl/bin/GetNodeState.pl | |
parent | 5224e612edc9f5af2f93051a41000a36ca6c5c93 (diff) |
update bootstrap section of scripts
Diffstat (limited to 'vespaclient/src/perl/bin/GetNodeState.pl')
-rwxr-xr-x | vespaclient/src/perl/bin/GetNodeState.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vespaclient/src/perl/bin/GetNodeState.pl b/vespaclient/src/perl/bin/GetNodeState.pl index f7ac5a24918..28f3cf99b1f 100755 --- a/vespaclient/src/perl/bin/GetNodeState.pl +++ b/vespaclient/src/perl/bin/GetNodeState.pl @@ -52,9 +52,21 @@ sub findhome { die "FATAL: Missing VESPA_HOME environment variable\n"; } +sub findhost { + $ENV{'PATH'} = $ENV{'VESPA_HOME'} . '/bin:' . $ENV{'PATH'}; + my $tmp = $ENV{'VESPA_HOSTNAME'}; + if (!defined $tmp) { + $tmp = `vespa-detect-hostname` or die "Could not detect hostname\n"; + } + system("vespa-validate-hostname $tmp"); + ( $? == 0 ) or die "Could not validate hostname\n"; +} + BEGIN { my $tmp = findhome(); $ENV{'VESPA_HOME'} = $tmp; + $tmp = findhost(); + $ENV{'VESPA_HOSTNAME'} = $tmp; } my $VESPA_HOME = $ENV{'VESPA_HOME'}; |