Skip to content

Instantly share code, notes, and snippets.

@jeremy4971
Last active January 6, 2024 10:29
Show Gist options
  • Save jeremy4971/fb69f09670668d7643d4a6d0da3eaa21 to your computer and use it in GitHub Desktop.
Save jeremy4971/fb69f09670668d7643d4a6d0da3eaa21 to your computer and use it in GitHub Desktop.
#!/bin/bash
###
#
# Created : 2023-03-09
# Last Modified : 2023-03-09
# Version : 1.0
# Tested with : macOS 13.2.1
#
###
# Remove old local.cfg
if [ -e "/Applications/GLPI-Agent/etc/conf.d/local.cfg" ]; then
echo "Removing local.cfg"
rm -fv "/Applications/GLPI-Agent/etc/conf.d/local.cfg"
fi
# Create local.cfg
# Show the file in Finder with this command line : open "/Applications/GLPI-Agent/etc/conf.d/"
cat <<EOT >> "/Applications/GLPI-Agent/etc/conf.d/local.cfg"
# URL of GLPI
server = http://root-of-your-glpi.com
# Generate some debug in logs. 0 is false. 1 is true.
debug = 0
# Optional tag for the computers
tag = LaClementine
EOT
# Restart the GLPI Launch Daemon
launchctl stop org.glpi-project.glpi-agent
sleep 1
launchctl start org.glpi-project.glpi-agent
# To force an inventory update, open the link bellow on the computer that has the agent.
# http://localhost:62354/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment