Update : script GPLI change deb to pl
This commit is contained in:
parent
828a49c7a3
commit
6d1294f56c
@ -21,17 +21,17 @@ install_glpi_agent() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
log_message "INFO" "Installing dependencies for GLPI agent"
|
# log_message "INFO" "Installing dependencies for GLPI agent"
|
||||||
apt-get install -y dmidecode hwdata ucf hdparm perl libuniversal-require-perl \
|
# 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 \
|
# 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 \
|
# 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 \
|
# libio-socket-ssl-perl libnet-snmp-perl libcrypt-des-perl libnet-nbname-perl \
|
||||||
libdigest-hmac-perl
|
# libdigest-hmac-perl
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
# if [ $? -ne 0 ]; then
|
||||||
log_message "ERROR" "Failed to install dependencies for GLPI agent"
|
# log_message "ERROR" "Failed to install dependencies for GLPI agent"
|
||||||
return 1
|
# return 1
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# Determine the latest GLPI agent version and download URL for Debian/Ubuntu
|
# Determine the latest GLPI agent version and download URL for Debian/Ubuntu
|
||||||
log_message "INFO" "Determining latest GLPI agent version"
|
log_message "INFO" "Determining latest GLPI agent version"
|
||||||
@ -55,16 +55,18 @@ install_glpi_agent() {
|
|||||||
cd "$TEMP_DIR" || return 1
|
cd "$TEMP_DIR" || return 1
|
||||||
|
|
||||||
# Download the latest GLPI agent package
|
# Download the latest GLPI agent package
|
||||||
if [ "$ARCH" = "amd64" ]; then
|
# 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.deb"
|
||||||
else
|
DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent_$LATEST_VERSION-linux-installer.pl"
|
||||||
DOWNLOAD_URL="https://github.com/glpi-project/glpi-agent/releases/download/$LATEST_VERSION/glpi-agent_$LATEST_VERSION.deb"
|
# else
|
||||||
fi
|
# 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"
|
log_message "INFO" "Downloading GLPI agent from $DOWNLOAD_URL"
|
||||||
|
|
||||||
#wget "$DOWNLOAD_URL" -O glpi-agent.deb
|
#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
|
if [ $? -ne 0 ]; then
|
||||||
log_message "ERROR" "Failed to download GLPI agent"
|
log_message "ERROR" "Failed to download GLPI agent"
|
||||||
@ -74,7 +76,8 @@ install_glpi_agent() {
|
|||||||
|
|
||||||
# Install the GLPI agent package
|
# Install the GLPI agent package
|
||||||
log_message "INFO" "Installing 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
|
if [ $? -ne 0 ]; then
|
||||||
log_message "ERROR" "Failed to install GLPI agent package"
|
log_message "ERROR" "Failed to install GLPI agent package"
|
||||||
|
@ -70,8 +70,8 @@ install_essential_packages() {
|
|||||||
"software-properties-common"
|
"software-properties-common"
|
||||||
"curl"
|
"curl"
|
||||||
"wget"
|
"wget"
|
||||||
"ufw"
|
# "ufw"
|
||||||
"unattended-upgrades"
|
# "unattended-upgrades"
|
||||||
"apt-listchanges"
|
"apt-listchanges"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user