diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-05-16 06:49:56 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-05-16 07:32:17 +0000 |
commit | a51021d1a2e737deefde42777e58d8e364af91ad (patch) | |
tree | 51a80363a1a19af91758c4322340ad5ea3ca4786 /configgen | |
parent | 8cabaa3da3bdf7a1de5cbf320772edd676763b26 (diff) |
update bootstrap
Diffstat (limited to 'configgen')
-rwxr-xr-x | configgen/bin/make-config.pl | 11 | ||||
-rwxr-xr-x | configgen/bin/make-configold.pl | 11 |
2 files changed, 14 insertions, 8 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; } diff --git a/configgen/bin/make-configold.pl b/configgen/bin/make-configold.pl index bbf7322a059..d299d09d3be 100755 --- a/configgen/bin/make-configold.pl +++ b/configgen/bin/make-configold.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; } |