Ajout d'une dépendance sur un module SSL pour Perl.
[auf-inventaire.git] / auf-inventaire-config
CommitLineData
f62a9240
P
1#!/bin/sh
2# script de mise à jour de la config' de FusionInventory
3# syntaxe : auf-inventaire-config [<tag>]
4
5update_file() {
6 file="$1" ; line="$2"
7 grep -q -x "${line}" "${file}" && return
8 left_part="`echo "${line}" | cut -d'=' -f1`="
9 sed -i "/^${left_part}/s/^/#/" "${file}"
10 echo "${line}" >> "${file}"
11}
12
13while read line
14do
15 update_file "/etc/fusioninventory/agent.cfg" "${line}"
16done << __EOF__
17server = https://glpi.auf.org/glpi/plugins/fusioninventory/
18no-task = deploy
19#ca-cert-file = /etc/ssl/certs/AUF-RACINE+BA.pem
20no-ssl-check = 1
21no-httpd = 1
293d39a1 22logger = Syslog
f62a9240
P
23__EOF__
24
25if [ -n "$1" ]
26then
27 update_file "/etc/fusioninventory/agent.cfg" "tag = $1"
28fi
29
30while read line
31do
32 update_file "/etc/default/fusioninventory-agent" "${line}"
33done << __EOF__
34MODE=daemon
35__EOF__
36
37service fusioninventory-agent stop
38sleep 2
39service fusioninventory-agent start