amidaware / rmmagent

Tactical RMM Agent
https://github.com/amidaware/tacticalrmm
Other
132 stars 76 forks source link

Macagent #6

Closed redanthrax closed 2 years ago

redanthrax commented 2 years ago

Must use the following for build. Must have CGO enabled. env GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o bin/macagent

bbrendon commented 2 years ago

@wh1te909 I don't suppose we can get this merged in?

wh1te909 commented 2 years ago

needs to just be refactored with build tags because it's exactly same as linux agent code so we can just have 1 file with a build tag for both linux and darwin instead of duplicate files

wh1te909 commented 2 years ago

go 1.19 will add a unix build constraint so we can just put all linux and mac stuff into the same file called agent_unix.go https://tip.golang.org/doc/go1.19#go-unix

Until that is released, we can still create a file named agent_unix.go and get rid of agent_linux.go and just use build tags at the top of the file like this // +build !windows

if there are linux or mac specific functions that are not shared, then we can keep agent_linux.go and agent_darwin.go and put them in there, but most of the stuff will move to agent_unix.go