Update glpi.sh

This commit is contained in:
Nícolas Pastorello 2025-01-03 15:21:47 -03:00 committed by GitHub
parent 34abc9d78b
commit 64bc8dec73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,14 +29,13 @@ function update_script() {
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /var/www/html/glpi/ ]]; then if [[ ! -d /opt/glpi ]]; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
RELEASE=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/') RELEASE=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to v${RELEASE}" msg_error "Ther is currently no automatic update function for ${APP}."
#Auto update under development
else else
msg_ok "No update required. ${APP} is already at v${RELEASE}." msg_ok "No update required. ${APP} is already at v${RELEASE}."
fi fi