diff options
author | Arne Juul <arnej@yahooinc.com> | 2022-08-29 12:14:29 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2022-08-29 13:46:46 +0000 |
commit | fc825f4e3b5057a112f435cb44c7834d0ca80951 (patch) | |
tree | a836a416a70d254c0874361f84b2b23a04c647f7 /client/go | |
parent | a4ec2ec80e0d3dfaef66a582ea6e47a071de2378 (diff) |
add binary replacing some perl snippets
Diffstat (limited to 'client/go')
-rw-r--r-- | client/go/script-utils/main.go | 30 |
1 files changed, 30 insertions, 0 deletions
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]) + } +} |