This repository has been archived on 2023-12-11. You can view files and clone it, but cannot push or open issues or pull requests.
archive/shell/gitea-update/gitea-update.sh

10 lines
404 B
Bash
Raw Permalink Normal View History

2023-07-29 14:42:28 +03:00
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ]
then echo "Use sudo!"
exit
fi
systemctl stop gitea.service
LAST_GITEA_BINARY=$(curl -s https://api.github.com/repos/go-gitea/gitea/releases/latest \
| grep browser_download_url | cut -d '"' -f 4 | grep $(echo $(uname)-$(dpkg --print-architecture) \
| sed 's/\(.*\)/\L\1/')$) && wget -O /usr/local/bin/gitea $LAST_GITEA_BINARY
systemctl start gitea.service