Skip to content

Instantly share code, notes, and snippets.

@AleksdemSA
Last active April 14, 2023 06:35
Show Gist options
  • Select an option

  • Save AleksdemSA/f9dd6941fbdbadc71ef3451d5621a412 to your computer and use it in GitHub Desktop.

Select an option

Save AleksdemSA/f9dd6941fbdbadc71ef3451d5621a412 to your computer and use it in GitHub Desktop.
update gitea
#!/bin/bash
GITEA_FOLDER='/opt/gitea'
RELEASE=`curl --silent "https://api.github.com/repos/go-gitea/gitea/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/v//g'`
printf "\033[92m"
printf "\nRelease Number: $RELEASE \n"
printf "\033[91m"
printf "\nsystemctl stop gitea.service\n"
printf "\033[0m"
systemctl stop gitea
wget https://github.com/go-gitea/gitea/releases/download/v$RELEASE/gitea-$RELEASE-linux-amd64 -O $GITEA_FOLDER/gitea
chmod u+x $GITEA_FOLDER/gitea
printf "\033[92m"
echo "starting gitea.service..."
printf "\033[0m"
systemctl start gitea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment