Skip to content

Instantly share code, notes, and snippets.

@tcarrondo
Last active March 24, 2023 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcarrondo/d5cbb858f8c676f312bbf20e923f173a to your computer and use it in GitHub Desktop.
Save tcarrondo/d5cbb858f8c676f312bbf20e923f173a to your computer and use it in GitHub Desktop.
Easy update gitea binary (living on /opt)
#!/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