Update : script glpi

This commit is contained in:
Hubert Cornet 2025-04-25 15:41:45 +02:00
parent 6d1294f56c
commit 2cd2c4c712

View File

@ -55,18 +55,12 @@ install_glpi_agent() {
cd "$TEMP_DIR" || return 1
# Download the latest GLPI agent package
# if [ "$ARCH" = "amd64" ]; then
# DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent_$LATEST_VERSION.deb"
DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent_$LATEST_VERSION-linux-installer.pl"
# else
# DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent_$LATEST_VERSION.deb"
# DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent_$LATEST_VERSION-linux-installer.pl"
# fi
DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent-$LATEST_VERSION-linux-installer.pl"
log_message "INFO" "Downloading GLPI agent from $DOWNLOAD_URL"
#wget "$DOWNLOAD_URL" -O glpi-agent.deb
curl -L -o "glpi-agent_$LATEST_VERSION.pl" "$DOWNLOAD_URL"
#
wget "$DOWNLOAD_URL" -O "glpi-agent-$LATEST_VERSION.pl"
if [ $? -ne 0 ]; then
log_message "ERROR" "Failed to download GLPI agent"
@ -77,7 +71,7 @@ install_glpi_agent() {
# Install the GLPI agent package
log_message "INFO" "Installing GLPI agent package"
#dpkg -i glpi-agent_$LATEST_VERSION.deb
perl glpi-agent-$LATEST_VERSION-linux-installer.pl --reinstall --type=all -v >> /dev/null
perl glpi-agent-$LATEST_VERSION-linux-installer.pl --reinstall --type=all -v >> /dev/null
if [ $? -ne 0 ]; then
log_message "ERROR" "Failed to install GLPI agent package"