-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_go.sh
43 lines (31 loc) · 1.2 KB
/
build_go.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Set the output directory
OUTPUT_DIR="build"
# Create the output directory if it doesn't exist
mkdir -p $OUTPUT_DIR
# Function to build for a specific OS and architecture
build() {
local GOOS=$1
local GOARCH=$2
local OUTPUT=$3
echo "Building for $GOOS ($GOARCH)..."
GOOS=$GOOS GOARCH=$GOARCH go build -o $OUTPUT_DIR/$OUTPUT CVE-2024-6387-OpenSSH-Vulnerability-Checker.go
if [ $? -eq 0 ]; then
echo "Build for $GOOS ($GOARCH) succeeded."
else
echo "Build for $GOOS ($GOARCH) failed."
fi
}
# Build for Windows (amd64)
build windows amd64 CVE-2024-6387-OpenSSH-Vulnerability-Checker-windows-amd64.exe
# Build for Windows (ARM)
build windows arm64 CVE-2024-6387-OpenSSH-Vulnerability-Checker-windows-arm64.exe
# Build for Linux (amd64)
build linux amd64 CVE-2024-6387-OpenSSH-Vulnerability-Checker-linux-amd64
# Build for Linux (ARM)
build linux arm64 CVE-2024-6387-OpenSSH-Vulnerability-Checker-linux-arm64
# Build for MacOS (amd64)
build darwin amd64 CVE-2024-6387-OpenSSH-Vulnerability-Checker-darwin-amd64
# Build for MacOS (ARM)
build darwin arm64 CVE-2024-6387-OpenSSH-Vulnerability-Checker-darwin-arm64
echo "Build completed. Executables are in the $OUTPUT_DIR directory."