DenyIP-go/build-static-bin.sh

14 lines
336 B
Bash
Raw Normal View History

2025-01-14 18:05:01 +08:00
#!/bin/bash
set -x
libcap=$(pkg-config --libs --static libcap)
libpcap=$(pkg-config --libs --static libpcap)
dbus=$(pkg-config --libs --static dbus-1)
a="'"
eval "CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -ldflags ${a}-extldflags \"-static ${libpcap} ${dbus} ${libcap} -lc\"${a}"
if test -f denyip; then
upx -9 denyip
fi