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 /vespaclient/src | |
parent | 8cabaa3da3bdf7a1de5cbf320772edd676763b26 (diff) |
update bootstrap
Diffstat (limited to 'vespaclient/src')
-rwxr-xr-x | vespaclient/src/perl/bin/GetClusterState.pl | 11 | ||||
-rwxr-xr-x | vespaclient/src/perl/bin/GetNodeState.pl | 11 | ||||
-rwxr-xr-x | vespaclient/src/perl/bin/SetNodeState.pl | 11 |
3 files changed, 21 insertions, 12 deletions
diff --git a/vespaclient/src/perl/bin/GetClusterState.pl b/vespaclient/src/perl/bin/GetClusterState.pl index 155db87f34e..aee988c74ff 100755 --- a/vespaclient/src/perl/bin/GetClusterState.pl +++ b/vespaclient/src/perl/bin/GetClusterState.pl @@ -53,14 +53,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/vespaclient/src/perl/bin/GetNodeState.pl b/vespaclient/src/perl/bin/GetNodeState.pl index 1e048df4b40..c303b94be90 100755 --- a/vespaclient/src/perl/bin/GetNodeState.pl +++ b/vespaclient/src/perl/bin/GetNodeState.pl @@ -53,14 +53,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/vespaclient/src/perl/bin/SetNodeState.pl b/vespaclient/src/perl/bin/SetNodeState.pl index 77ebf9a2456..b1fc32c02b3 100755 --- a/vespaclient/src/perl/bin/SetNodeState.pl +++ b/vespaclient/src/perl/bin/SetNodeState.pl @@ -53,14 +53,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; } |