mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-16 16:19:22 +01:00
Aminda Suomalainen
a1719b09f5
OK, so the version should be 7.0.0, but the instance where this script is made for is a bit behind and I want to update to that point release first.
30 lines
1.1 KiB
Bash
Executable File
30 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
VERSION=1.21.11-1
|
|
PLATFORM=linux-amd64
|
|
|
|
# If the signature is already downloaded, don't redownload it
|
|
if [ -f "forgejo-$VERSION-$PLATFORM.asc" ]; then
|
|
printf "Forĝejo signature already downloaded.\n"
|
|
else
|
|
printf "Downloading Forĝejo %b-%b signature…\n" "$VERSION" "$PLATFORM"
|
|
curl -LO "https://codeberg.org/forgejo/forgejo/releases/download/v$VERSION/forgejo-$VERSION-$PLATFORM.asc"
|
|
fi
|
|
|
|
# If the binary is already downloaded, don't redownload it
|
|
if [ -f "forgejo-$VERSION-$PLATFORM" ]; then
|
|
printf "Forĝejo already downloaded.\n"
|
|
else
|
|
printf "Downloading Forĝejo %b on %b\n" "$VERSION" "$PLATFORM"
|
|
curl -LO "https://codeberg.org/forgejo/forgejo/releases/download/v$VERSION/forgejo-$VERSION-$PLATFORM"
|
|
fi
|
|
|
|
# The last easy to automate part.
|
|
printf "Verifying signature…\n"
|
|
gpg --verify forgejo-$VERSION-$PLATFORM.asc
|
|
|
|
printf "Final steps: \n\t 1. Place the binary where the systemd service expects it.\n\t \
|
|
2. sudo chmod -v a+rx forgejo-%b-%b\n\t \
|
|
3. sudo ln -sfv forgejo-%b-%b gitea \n\t \
|
|
4. sudo systemctl restart gitea.service" "$VERSION" "$PLATFORM" "$VERSION" "$PLATFORM"
|
|
echo
|