mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-09 17:29:16 +00:00
Update glpi.sh
This commit is contained in:
parent
0348074c4c
commit
396fbf7eab
36
ct/glpi.sh
36
ct/glpi.sh
@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Nícolas Pastorello (opastorello)
|
||||
# Author: kristocopani
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://semaphoreui.com/
|
||||
|
||||
# App Default Values
|
||||
APP="GLPI"
|
||||
@ -15,18 +16,45 @@ var_os="debian"
|
||||
var_version="12"
|
||||
var_unprivileged="1"
|
||||
|
||||
# App Output & Base Settings
|
||||
header_info "$APP"
|
||||
base_settings
|
||||
|
||||
# Core
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /var/www/html/glpi/ ]]; then
|
||||
|
||||
if [[ ! -f /etc/systemd/system/semaphore.service ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
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/semaphoreui/semaphore/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop semaphore
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Updating ${APP} to v${RELEASE}"
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
cd /opt
|
||||
wget -q https://github.com/semaphoreui/semaphore/releases/download/v${RELEASE}/semaphore_${RELEASE}_linux_amd64.deb
|
||||
dpkg -i semaphore_${RELEASE}_linux_amd64.deb &>/dev/null
|
||||
echo "${RELEASE}" >"/opt/${APP}_version.txt"
|
||||
msg_ok "Updated ${APP} to v${RELEASE}"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start semaphore
|
||||
msg_ok "Started Service"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/semaphore_${RELEASE}_linux_amd64.deb
|
||||
msg_ok "Cleaned"
|
||||
msg_ok "Updated Successfully"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}."
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user