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
396fbf7eab
commit
be9765645a
16
ct/glpi.sh
16
ct/glpi.sh
@ -30,30 +30,18 @@ function update_script() {
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /etc/systemd/system/semaphore.service ]]; then
|
||||
if [[ ! -d /var/www/html/glpi/ ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
RELEASE=$(curl -s https://api.github.com/repos/semaphoreui/semaphore/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
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
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop semaphore
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Updating ${APP} to v${RELEASE}"
|
||||
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}."
|
||||
|
Loading…
Reference in New Issue
Block a user