diff options
Diffstat (limited to 'vespabase/src/start-vespa-base.sh')
-rwxr-xr-x | vespabase/src/start-vespa-base.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vespabase/src/start-vespa-base.sh b/vespabase/src/start-vespa-base.sh index 096c63f9969..fdda5f85198 100755 --- a/vespabase/src/start-vespa-base.sh +++ b/vespabase/src/start-vespa-base.sh @@ -8,6 +8,10 @@ findpath () { myname=${0} mypath=${myname%/*} myname=${myname##*/} + empty_if_start_slash=${mypath%%/*} + if [ "${empty_if_start_slash}" ]; then + mypath=$(pwd)/${mypath} + fi if [ "$mypath" ] && [ -d "$mypath" ]; then return fi @@ -54,7 +58,19 @@ findroot () { exit 1 } +findhost () { + if [ "${VESPA_HOSTNAME}" = "" ]; then + VESPA_HOSTNAME=$(vespa-detect-hostname || hostname -f || hostname || echo "localhost") || exit 1 + fi + validate="${VESPA_HOME}/bin/vespa-validate-hostname" + if [ -f "$validate" ]; then + "$validate" "${VESPA_HOSTNAME}" || exit 1 + fi + export VESPA_HOSTNAME +} + findroot +findhost # END environment bootstrap section |