Update : script GPLI change deb to pl

This commit is contained in:
Hubert Cornet 2025-04-25 14:21:06 +02:00
parent 828a49c7a3
commit 6d1294f56c
2 changed files with 22 additions and 19 deletions

View File

@ -21,17 +21,17 @@ install_glpi_agent() {
fi
# Install dependencies
log_message "INFO" "Installing dependencies for GLPI agent"
apt-get install -y dmidecode hwdata ucf hdparm perl libuniversal-require-perl \
libxml-treepp-perl libyaml-perl libnet-cups-perl libnet-ip-perl libwww-perl \
libparse-edid-perl libproc-daemon-perl libfile-which-perl libhttp-daemon-perl \
libio-socket-ssl-perl libnet-snmp-perl libcrypt-des-perl libnet-nbname-perl \
libdigest-hmac-perl
# log_message "INFO" "Installing dependencies for GLPI agent"
# apt-get install -y dmidecode hwdata ucf hdparm perl libuniversal-require-perl \
# libxml-treepp-perl libyaml-perl libnet-cups-perl libnet-ip-perl libwww-perl \
# libparse-edid-perl libproc-daemon-perl libfile-which-perl libhttp-daemon-perl \
# libio-socket-ssl-perl libnet-snmp-perl libcrypt-des-perl libnet-nbname-perl \
# libdigest-hmac-perl
if [ $? -ne 0 ]; then
log_message "ERROR" "Failed to install dependencies for GLPI agent"
return 1
fi
# if [ $? -ne 0 ]; then
# log_message "ERROR" "Failed to install dependencies for GLPI agent"
# return 1
# fi
# Determine the latest GLPI agent version and download URL for Debian/Ubuntu
log_message "INFO" "Determining latest GLPI agent version"
@ -55,16 +55,18 @@ 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"
else
DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent_$LATEST_VERSION.deb"
fi
# 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
log_message "INFO" "Downloading GLPI agent from $DOWNLOAD_URL"
#wget "$DOWNLOAD_URL" -O glpi-agent.deb
curl -L -o "glpi-agent_$LATEST_VERSION.deb" "$DOWNLOAD_URL"
curl -L -o "glpi-agent_$LATEST_VERSION.pl" "$DOWNLOAD_URL"
if [ $? -ne 0 ]; then
log_message "ERROR" "Failed to download GLPI agent"
@ -74,7 +76,8 @@ install_glpi_agent() {
# Install the GLPI agent package
log_message "INFO" "Installing GLPI agent package"
dpkg -i glpi-agent_$LATEST_VERSION.deb
#dpkg -i glpi-agent_$LATEST_VERSION.deb
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"

View File

@ -70,8 +70,8 @@ install_essential_packages() {
"software-properties-common"
"curl"
"wget"
"ufw"
"unattended-upgrades"
# "ufw"
# "unattended-upgrades"
"apt-listchanges"
)