Skip to content

Commit

Permalink
Add basic support for FreeBSD.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phyber committed Jan 14, 2019
1 parent 22b9c3f commit 46a31ef
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/aws-vault
/aws-vault-*
.DS_Store
*~
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions server/alias_freebsd.go
Original file line number Diff line number Diff line change
@@ -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()
}

0 comments on commit 46a31ef

Please sign in to comment.