Skip to content

Instantly share code, notes, and snippets.

@yppdr
Created May 2, 2023 13:04
Show Gist options
  • Select an option

  • Save yppdr/28fd4621fca8e303d7b0b81a4135f2e7 to your computer and use it in GitHub Desktop.

Select an option

Save yppdr/28fd4621fca8e303d7b0b81a4135f2e7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# 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 = https://ticketing.acelys.fr
# Generate some debug in logs. 0 is false. 1 is true.
debug = 0
# Optional tag for the computers
tag =
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/
#chmod +x init_glpi.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment