This repository has been archived on 2024-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
thelinuxlist/scripts/giteaupdate.sh

34 lines
958 B
Bash

#!/bin/bash
while true
do
read -r -p "Would you like to Update Gitea? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
ping -c1 "github.com" &>"/dev/null"
if [[ "${?}" -ne 0 ]]; then
echo "I am unable to access Github.com, that is needed to continue this Install."
elif [[ "${#args[@]}" -eq 0 ]]; then
GITEA_VER="1.18.3"
sudo systemctl stop gitea
sudo wget -O /usr/local/bin/gitea https://github.com/go-gitea/gitea/releases/download/v"$GITEA_VER"/gitea-"$GITEA_VER"-linux-amd64
sudo chmod +x /usr/local/bin/gitea
sudo chown -R git:git /var/lib/gitea
sudo chmod -R 750 /var/lib/gitea
sudo chown -R root:git /etc/gitea
sudo chmod -R 770 /etc/gitea
sudo systemctl start gitea
fi
echo "Gitea has been updated!"