Last active
March 24, 2023 22:58
-
-
Save tcarrondo/d5cbb858f8c676f312bbf20e923f173a to your computer and use it in GitHub Desktop.
Easy update gitea binary (living on /opt)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Binary location | |
LOCATION=/opt | |
# Grab latest version from Gitea website | |
VERSION=$(curl https://dl.gitea.com/gitea/version.json | jq -r .latest.version) | |
# downlaod latest | |
wget -O "$LOCATION"/gitea-"$VERSION"-linux-amd64 https://dl.gitea.io/gitea/"$VERSION"/gitea-"$VERSION"-linux-amd64 | |
# fix permissions | |
chmod +x "$LOCATION"/gitea-"$VERSION"-linux-amd64 | |
chown git: "$LOCATION"/gitea-"$VERSION"-linux-amd64 | |
# update link | |
ln -sf "$LOCATION"/gitea-"$VERSION"-linux-amd64 "$LOCATION"/gitea | |
# restart gitea | |
systemctl restart gitea |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment