diff --git a/install_glpi_agent.sh b/install_glpi_agent.sh new file mode 100755 index 0000000000000000000000000000000000000000..85550b21a2d378e305c653b7355d895f9a447010 --- /dev/null +++ b/install_glpi_agent.sh @@ -0,0 +1,11 @@ +#!/bin/bash +VERSION=1.11 +glpiver=$(dpkg -l | awk '/\sglpi-agent\s/{print $3}' | cut -d : -f 2 | cut -d - -f 1) +refip=$(ip a | awk '/inet 10\./{print $2}' | sed 's@/[0-9][0-9]$@@') +if [ "$glpiver" != "$VERSION" ]; then + cd /tmp + wget -O glpi-agent.pl https://github.com/glpi-project/glpi-agent/releases/download/$VERSION/glpi-agent-$VERSION-linux-installer.pl + perl /tmp/glpi-agent.pl --server=https://glpi.grenoble.fr/plugins/glpiinventory/ --tag=$refip --install --service --tasks=inventoy,deploy,inventory,NetDiscovery,NetInventory --type=all --runnow + rm glpi-agent.pl + glpi-agent +fi