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/src/apps/vespa-config | |
parent | 5224e612edc9f5af2f93051a41000a36ca6c5c93 (diff) |
update bootstrap section of scripts
Diffstat (limited to 'config/src/apps/vespa-config')
-rwxr-xr-x | config/src/apps/vespa-config/vespa-config.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/config/src/apps/vespa-config/vespa-config.pl b/config/src/apps/vespa-config/vespa-config.pl index 735a8054f52..d43016331f4 100755 --- a/config/src/apps/vespa-config/vespa-config.pl +++ b/config/src/apps/vespa-config/vespa-config.pl @@ -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'}; |