Created
December 11, 2021 14:29
-
-
Save floatzeI/94ef15973f8dff4d278db083f96d7e2e to your computer and use it in GitHub Desktop.
update gitea to latest 1.x version
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
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