diff options
Diffstat (limited to 'configgen/bin/make-config.pl')
-rwxr-xr-x | configgen/bin/make-config.pl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/configgen/bin/make-config.pl b/configgen/bin/make-config.pl index 7b1f1f833ab..13017a679e3 100755 --- a/configgen/bin/make-config.pl +++ b/configgen/bin/make-config.pl @@ -62,14 +62,17 @@ sub findhome { } sub findhost { - $ENV{'PATH'} = $ENV{'VESPA_HOME'} . '/bin:' . $ENV{'PATH'}; my $tmp = $ENV{'VESPA_HOSTNAME'}; + my $bin = $ENV{'VESPA_HOME'} . "/bin"; if (!defined $tmp) { - $tmp = `vespa-detect-hostname` or die "Could not detect hostname\n"; + $tmp = `${bin}/vespa-detect-hostname || hostname -f || hostname || echo "localhost"`; chomp $tmp; } - system("vespa-validate-hostname $tmp"); - ( $? == 0 ) or die "Could not validate hostname\n"; + my $validate = "${bin}/vespa-validate-hostname"; + if (-f "${validate}") { + system("${validate} $tmp"); + ( $? == 0 ) or die "Could not validate hostname\n"; + } return $tmp; } |