Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brahimmachkouri/5f24f71d42baf842e25db40efe467c53 to your computer and use it in GitHub Desktop.
Save brahimmachkouri/5f24f71d42baf842e25db40efe467c53 to your computer and use it in GitHub Desktop.
Automatic installation of the latest version of fusioninventory in GLPI plugins directory
#!/bin/bash
githubproject="https://github.com/fusioninventory/fusioninventory-for-glpi/releases/latest/"
url=$(curl -Ls -o /dev/null -w %{url_effective} $githubproject)
version=${url##*/}
tag=${version:4}
wget https://github.com/fusioninventory/fusioninventory-for-glpi/releases/download/$version/fusioninventory-$tag.tar.bz2
glpi_install=$(find /var -type f -name glpicrypt.key | sed -E 's/\/config\/glpicrypt\.key//')
tar xvf fusioninventory-$tag.tar.bz2 -C "$glpi_install/plugins/"
chown -R www-data:www-data "$glpi_install/plugins/fusioninventory"
rm fusioninventory-$tag.tar.bz2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment