add update forgejo script

This commit is contained in:
Sebastian Cabrera 2026-03-20 16:08:03 -04:00
parent ecb4c14600
commit e8a6334d33
Signed by: okseby
GPG key ID: 37783FE2501AE402

27
update-forgejo.sh Normal file
View file

@ -0,0 +1,27 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
echo "Example: $0 11.0.10"
exit 1
fi
VERSION="$1"
case "$(uname -m)" in
x86_64) ARCH="amd64" ;;
aarch64) ARCH="arm64" ;;
armv7l) ARCH="arm-6" ;;
*)
echo "Unsupported architecture: $(uname -m)"
exit 1
;;
esac
BINARY="forgejo-${VERSION}-linux-${ARCH}"
wget "https://codeberg.org/forgejo/forgejo/releases/download/v${VERSION}/${BINARY}"
chmod +x "$BINARY"
systemctl stop forgejo
cp "$BINARY" /usr/local/bin/forgejo
systemctl start forgejo.service