2025-07-09 13:19:43 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# Determine the platform
|
|
|
|
|
OS=$(uname -s)
|
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
|
|
|
|
|
|
# Map architecture
|
|
|
|
|
if [ "$ARCH" == "x86_64" ]; then
|
|
|
|
|
ARCH="amd64"
|
|
|
|
|
elif [[ "$ARCH" == "arm64" || "$ARCH" == "aarch64" ]]; then
|
|
|
|
|
ARCH="arm64"
|
|
|
|
|
else
|
|
|
|
|
echo "Unsupported architecture: $ARCH"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Map OS
|
|
|
|
|
case "$OS" in
|
|
|
|
|
Linux) OS="linux" ;;
|
|
|
|
|
Darwin) OS="darwin" ;;
|
|
|
|
|
*) echo "Unsupported OS: $OS"; exit 1 ;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
# Construct the download URL
|
2025-08-16 15:37:08 +01:00
|
|
|
VERSION="v0.0.3"
|
2025-07-09 13:19:43 +01:00
|
|
|
BINARY_URL="https://codeberg.org/headshed/infctl-cli/releases/download/$VERSION/infctl-$OS-$ARCH"
|
|
|
|
|
|
|
|
|
|
# Download the binary
|
|
|
|
|
echo "Downloading infctl binary for $OS-$ARCH..."
|
|
|
|
|
sudo curl -s -L "$BINARY_URL" -o /usr/local/bin/infctl
|
|
|
|
|
|
|
|
|
|
# Make it executable
|
|
|
|
|
sudo chmod +x /usr/local/bin/infctl
|
|
|
|
|
|
2025-08-16 15:37:08 +01:00
|
|
|
echo "infctl installed successfully!"
|