⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rmmagent-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,19 @@ function agent_compile() {
tar -xf "$TMPDIR/rmmagent.tar.gz" -C "$TMPDIR/"
rm "$TMPDIR/rmmagent.tar.gz"
cd "$TMPDIR/rmmagent-master"
# Force module mode and use a local module cache
export GO111MODULE=on
export GOMODCACHE="$TMPDIR/go-mod-cache"
export GOCACHE="$TMPDIR/go-build-cache"
mkdir -p "$GOMODCACHE"
case $system in
amd64) env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o "$TMPDIR/temp_rmmagent" ;;
x86) env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w" -o "$TMPDIR/temp_rmmagent" ;;
arm64) env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o "$TMPDIR/temp_rmmagent" ;;
armv6) env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags "-s -w" -o "$TMPDIR/temp_rmmagent" ;;
esac
cd "$TMPDIR"
rm -R "$TMPDIR/rmmagent-master"
rm -R "$TMPDIR/rmmagent-master" "$GOMODCACHE" "$GOCACHE"
}

function update_agent() {
Expand Down