diff options
author | Arne Juul <arnej@yahooinc.com> | 2022-08-29 14:43:19 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2022-08-29 14:43:19 +0000 |
commit | 8638009e20f14e36781e74be35238ef0fbb44335 (patch) | |
tree | 852489ae8e25e7ba0137c797f84e1bb2d8c84b50 /vespabase | |
parent | 1226c9bc694600622154777ae9f88901cd421e28 (diff) |
replace two perl snippets with calls to script-utils
Diffstat (limited to 'vespabase')
-rwxr-xr-x | vespabase/src/common-env.sh | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/vespabase/src/common-env.sh b/vespabase/src/common-env.sh index afed1595a19..628ebe6b074 100755 --- a/vespabase/src/common-env.sh +++ b/vespabase/src/common-env.sh @@ -35,26 +35,7 @@ consider_fallback () { read_conf_file () { deffile="$VESPA_HOME/conf/vespa/default-env.txt" if [ -f "${deffile}" ]; then - eval $(perl -ne ' - chomp; - my ($action, $varname, $value) = split(" ", $_, 3); - $varname =~ s{[.]}{__}g; - if ($varname !~ m{^\w+}) { - # print STDERR "invalid var name $varname" - next; - } - if ($action eq "fallback" || $action eq "override") { - next if ($action eq "fallback" && $ENV{$varname} ne ""); - # quote value - if ($value !~ m{^["][^"]*["]$} ) { - $value =~ s{(\W)}{\\$1}g; - } - print "$varname=$value; export $varname; " - } - if ($action eq "unset") { - print "export -n $varname; unset $varname; " - } - ' < $deffile) + eval $(${VESPA_HOME}/libexec/vespa/script-utils export-env) fi } @@ -329,8 +310,7 @@ use_configserver_if_needed () { } getJavaOptionsIPV46() { - canon_ipv4=$(hostname | perl -pe 'chomp; ($_,$rest) = gethostbyname($_);') - if [ -z "${canon_ipv4}" ]; then + if ${VESPA_HOME}/libexec/vespa/script-utils ipv6-only; then echo " -Djava.net.preferIPv6Addresses=true" fi } |