fixed update_script and obtaining latest releases

This commit is contained in:
Miguel Muniz 2024-07-22 10:40:16 -07:00
parent 381420ad50
commit 2fd158625d
62 changed files with 4904 additions and 4 deletions

View file

@ -27,7 +27,7 @@ EOF
header_info
echo -e "Loading..."
APP="gitea"
var_disk="5"
var_disk="8"
var_cpu="1"
var_ram="512"
var_os="debian"
@ -63,10 +63,20 @@ function default_settings() {
function update_script() {
header_info
if [[ ! -f /lib/systemd/system/gitea.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_info "Updating ${APP} LXC"
RELEASE=$(wget -q https://github.com/go-gitea/gitea/releases/latest -O - | grep "title>Release" | cut -d " " -f 4)
VERSION=${RELEASE#v}
msg_info "Updating ${APP}"
wget -q https://github.com/go-gitea/gitea/releases/download/$RELEASE/gitea-$VERSION-linux-amd64
systemctl stop gitea
rm -rf /usr/local/bin/gitea
mv gitea* /usr/local/bin/gitea
systemctl start gitea
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/nullexit
msg_ok "Updated ${APP} to ${RELEASE}"
else
msg_ok "No update required ${APP} is already at ${RELEASE}"
fi
exit
}