From 94c80e9ec2c06aafb3ca46c5a66a5e31c16850b9 Mon Sep 17 00:00:00 2001 From: Billy Longman Date: Mon, 12 Jun 2023 13:13:57 -0400 Subject: [PATCH] Added darwin-arm64 and minor fixes --- Makefile | 4 +++- main.go | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 694d565..e27d078 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,14 @@ GO_FILES := $(shell find ./* -iname '*.go') GO_RUN := docker run --rm -e GO111MODULE=on -e CGO_ENABLED=0 -e VERSION=$(VERSION) -e HOME=/build/.cache -u $$(id -u $${USER}):$$(id -g $${USER}) -v $$PWD:/build -w /build golang:$(GO_VERSION) .PHONY: build clean -build: bin/linux-amd64/sip-ping bin/windows-amd64/sip-ping.exe bin/darwin-amd64/sip-ping +build: bin/linux-amd64/sip-ping bin/windows-amd64/sip-ping.exe bin/darwin-amd64/sip-ping bin/darwin-arm64/sip-ping bin/linux-amd64/sip-ping: $(GO_FILES) $(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/linux-amd64/sip-ping' bin/windows-amd64/sip-ping.exe: $(GO_FILES) $(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/windows-amd64/sip-ping.exe' +bin/darwin-arm64/sip-ping: $(GO_FILES) + $(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/darwin-arm64/sip-ping' bin/darwin-amd64/sip-ping: $(GO_FILES) $(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/darwin-amd64/sip-ping' diff --git a/main.go b/main.go index fe8c344..fec1be7 100644 --- a/main.go +++ b/main.go @@ -87,7 +87,7 @@ func main() { signal.Notify(interrupt, os.Interrupt) if len(*addr) == 0 { - log.Warn("No addr paramiter found!") + log.Warn("No addr parameter found!") flag.Usage() os.Exit(1) } @@ -136,7 +136,7 @@ func querySIP(url *url.URL, skipVerify *bool, request chan string, response chan var err error var conn net.Conn if url.Scheme == "tls" { - log.Debug("doing TLS sip") + log.Debug("Doing TLS sip") tlsClientConfig := &tls.Config{InsecureSkipVerify: *skipVerify} conn, err = tls.Dial("tcp", url.Host, tlsClientConfig) } else if url.Scheme == "udp" { @@ -153,7 +153,7 @@ func querySIP(url *url.URL, skipVerify *bool, request chan string, response chan defer conn.Close() log.Debug("Rendering SIP Request") req := renderRequest(TCP_OPTIONS, conn.LocalAddr().String(), url.Scheme) - log.Debug("Request Rendered, writting request") + log.Debug("Request Rendered, writing request") _, err = conn.Write([]byte(req)) if err != nil { response_err <- err