From 46a31efd49751c88aa1d3124f10c7a287c9979f1 Mon Sep 17 00:00:00 2001 From: David O'Rourke Date: Mon, 14 Jan 2019 16:51:51 +0000 Subject: [PATCH] Add basic support for FreeBSD. This commit adds basic support for FreeBSD by adding an `alias_freebsd.go`. The only supported backend is the `file` backend when compiled for FreeBSD. We also add some `.gitignore` entries for vim backup files and add entries to the `Makefile` to compile freebsd-{389,amd64} binaries. --- .gitignore | 1 + Makefile | 10 ++++++++-- server/alias_freebsd.go | 9 +++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 server/alias_freebsd.go diff --git a/.gitignore b/.gitignore index d8cb13264..07b14de5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /aws-vault /aws-vault-* .DS_Store +*~ diff --git a/Makefile b/Makefile index fb4fb9d90..57072faf5 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,13 @@ aws-vault-darwin-amd64: $(SRC) aws-vault-windows-386.exe: $(SRC) GOOS=windows GOARCH=386 go build -o $@ -ldflags="$(FLAGS)" . -release: aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe +aws-vault-freebsd-386: $(SRC) + GOOS=freebsd GOARCH=386 go build -o $@ -ldflags="$(FLAGS)" . + +aws-vault-freebsd-amd64: $(SRC) + GOOS=freebsd GOARCH=amd64 go build -o $@ -ldflags="$(FLAGS)" . + +release: aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe aws-vault-freebsd-386 aws-vault-freebsd-amd64 clean: - rm -f aws-vault aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe + rm -f aws-vault aws-vault-linux-amd64 aws-vault-darwin-amd64 aws-vault-windows-386.exe aws-vault-freebsd-386 aws-vault-freebsd-amd64 diff --git a/server/alias_freebsd.go b/server/alias_freebsd.go new file mode 100644 index 000000000..97973ce50 --- /dev/null +++ b/server/alias_freebsd.go @@ -0,0 +1,9 @@ +// build: freebsd + +package server + +import "os/exec" + +func installNetworkAlias() ([]byte, error) { + return exec.Command("ifconfig", "lo0", "alias", "169.254.169.254").CombinedOutput() +}