Projet

Général

Profil

maj_param_ocs.patch

Joël Cuissinat, 15/05/2014 16:46

Télécharger (1,68 ko)

Voir les différences:

eole/glpi/maj_param_ocs.sh
1 1
#!/bin/bash
2 2

  
3 3
. /usr/bin/ParseDico
4
. /etc/eole/containers.conf
4 5

  
5 6
# récupération des paramètres de connexion à la base de données OCS
6
USEROCS=$(grep -R 'COMPTE_BASE' /usr/share/ocsinventory-reports/dbconfig.inc.php |cut -d'"' -f4)
7
PWDOCS=$(grep -R 'PSWD_BASE' /usr/share/ocsinventory-reports/dbconfig.inc.php |cut -d'"' -f4)
7
USEROCS=$(grep -R 'COMPTE_BASE' $container_path_web/usr/share/ocsinventory-reports/dbconfig.inc.php |cut -d'"' -f4)
8
PWDOCS=$(grep -R 'PSWD_BASE' $container_path_web/usr/share/ocsinventory-reports/dbconfig.inc.php |cut -d'"' -f4)
8 9

  
9 10
# récupération des paramètres de connexion à la base de données GLPI
10
PWD=$(grep -R 'dbpassword' /var/www/html/glpi/config/config_db.php |cut -d'"' -f2)
11
PWD=$(grep -R 'dbpassword' $container_path_web/var/www/html/glpi/config/config_db.php |cut -d'"' -f2)
11 12

  
12 13
# mise à jour de la table contenant les paramètres de connexion glpi à la base OCS
13
/usr/bin/mysql -u admin_glpi -p$PWD -D glpi -e "UPDATE glpi_ocsservers SET ocs_db_passwd = '"$PWDOCS"' WHERE glpi_ocsservers.name = 'localhost'"
14
/usr/bin/mysql -u admin_glpi -p$PWD -D glpi -e "UPDATE glpi_ocsservers SET ocs_db_user = '"$USEROCS"' WHERE glpi_ocsservers.name = 'localhost'"
14
/usr/bin/mysql -u admin_glpi -h$adresse_ip_mysql -p$PWD -D glpi -e "UPDATE glpi_ocsservers SET ocs_db_passwd = '"$PWDOCS"' WHERE glpi_ocsservers.name = 'localhost'"
15
/usr/bin/mysql -u admin_glpi -h$adresse_ip_mysql -p$PWD -D glpi -e "UPDATE glpi_ocsservers SET ocs_db_user = '"$USEROCS"' WHERE glpi_ocsservers.name = 'localhost'"