summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/perl
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-05-09 14:00:59 +0000
committerArne Juul <arnej@yahoo-inc.com>2018-05-14 10:08:15 +0000
commitcc5f5b2b41db293a9ce7ef554adde9e776fd1ad2 (patch)
tree4afd49f607f3b11f077aa61a8187585dcfa98dbe /config-model/src/main/perl
parent5224e612edc9f5af2f93051a41000a36ca6c5c93 (diff)
update bootstrap section of scripts
Diffstat (limited to 'config-model/src/main/perl')
-rwxr-xr-xconfig-model/src/main/perl/vespa-deploy12
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'};