summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArne Juul <arnej@yahooinc.com>2022-08-29 12:14:29 +0000
committerArne Juul <arnej@yahooinc.com>2022-08-29 13:46:46 +0000
commitfc825f4e3b5057a112f435cb44c7834d0ca80951 (patch)
treea836a416a70d254c0874361f84b2b23a04c647f7 /client
parenta4ec2ec80e0d3dfaef66a582ea6e47a071de2378 (diff)
add binary replacing some perl snippets
Diffstat (limited to 'client')
-rw-r--r--client/CMakeLists.txt1
-rw-r--r--client/go/script-utils/main.go30
2 files changed, 31 insertions, 0 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index c87e9855fe9..07361e4b2eb 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -13,3 +13,4 @@ add_custom_target(vespalog_logfmt ALL DEPENDS ${GODIR}/bin/vespa-logfmt)
install(PROGRAMS ${GODIR}/bin/vespa-logfmt DESTINATION bin)
install(PROGRAMS ${GODIR}/bin/vespa-deploy DESTINATION bin)
+install(PROGRAMS ${GODIR}/bin/script-utils DESTINATION libexec/vespa)
diff --git a/client/go/script-utils/main.go b/client/go/script-utils/main.go
new file mode 100644
index 00000000000..a7160691a5d
--- /dev/null
+++ b/client/go/script-utils/main.go
@@ -0,0 +1,30 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Author: arnej
+
+package main
+
+import (
+ "fmt"
+ "os"
+
+ "github.com/vespa-engine/vespa/client/go/vespa"
+)
+
+func main() {
+ if len(os.Args) < 2 {
+ fmt.Fprintln(os.Stderr, "actions: export-env, ipv6-only")
+ return
+ }
+ switch os.Args[1] {
+ case "export-env":
+ vespa.ExportDefaultEnvToSh()
+ case "ipv6-only":
+ if vespa.HasOnlyIpV6() {
+ os.Exit(0)
+ } else {
+ os.Exit(1)
+ }
+ default:
+ fmt.Fprintf(os.Stderr, "unknown action '%s'\n", os.Args[1])
+ }
+}