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 /config-model/src/main/perl | |
parent | 5224e612edc9f5af2f93051a41000a36ca6c5c93 (diff) |
update bootstrap section of scripts
Diffstat (limited to 'config-model/src/main/perl')
-rwxr-xr-x | config-model/src/main/perl/vespa-deploy | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/config-model/src/main/perl/vespa-deploy b/config-model/src/main/perl/vespa-deploy index 8a74d97e868..f13846332c6 100755 --- a/config-model/src/main/perl/vespa-deploy +++ b/config-model/src/main/perl/vespa-deploy @@ -54,9 +54,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'}; |