Skip to content

Instantly share code, notes, and snippets.

@floatzeI
Created December 11, 2021 14:29
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 floatzeI/94ef15973f8dff4d278db083f96d7e2e to your computer and use it in GitHub Desktop.
Save floatzeI/94ef15973f8dff4d278db083f96d7e2e to your computer and use it in GitHub Desktop.
update gitea to latest 1.x version
latest="$(curl https://api.github.com/repos/go-gitea/gitea/releases/latest)";
#echo $latest;
if [[ "$latest" =~ (https:\/\/github\.com\/go-gitea\/gitea\/releases\/download\/v1\.[0-9]+\.[0-9]+\/gitea-([0-9.]+)-linux-amd64) ]]; then
echo "$BASH_REMATCH"
url=$BASH_REMATCH;
echo $url;
e="$(wget $url)";
mv ~/gitea-1* ~/gitea;
systemctl stop gitea;
mv -f /usr/local/bin/gitea /usr/local/bin/gitea_old;
mv ~/gitea /usr/local/bin;
chmod +x /usr/local/bin/gitea;
systemctl restart gitea;
else
echo "could not find url"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment