centreon-web.postinst 1.77 KB
Newer Older
1
2
3
4
#!/bin/sh

if [ "$1" = "configure" ] ; then

5
6
7
8
9
10
11
12
13
14
15
16
17
18
  if [ "$(getent passwd centreon)" ]; then

    chown -R centreon:centreon /usr/share/centreon

    chmod 0775 \
      /usr/share/centreon/src \
      /usr/share/centreon/www \
      /usr/share/centreon/api
    
    chmod -R 0775 \
      /usr/share/centreon/www/img/media \
      /usr/share/centreon/www/install/install.conf.php \
      /usr/share/centreon/www/install/tmp \
      /usr/share/centreon/GPL_LIB/SmartyCache
19
  
20
  fi
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

  # Replace macros ----
  sed -i "s#@PHP_BIN@#/usr/bin/php#g" /usr/share/centreon/bin/centreon
  sed -i "s#@PHP_BIN@#/usr/bin/php#g" /usr/share/centreon/bin/console
  sed -i "s#@PHP_BIN@#/usr/bin/php#g" /usr/share/centreon/bin/export-mysql-indexes
  sed -i "s#@PHP_BIN@#/usr/bin/php#g" /usr/share/centreon/bin/generateSqlLite
  sed -i "s#@PHP_BIN@#/usr/bin/php#g" /usr/share/centreon/bin/import-mysql-indexes

  chmod +x \
    /usr/share/centreon/bin/centFillTrapDB \
    /usr/share/centreon/bin/centreonSyncArchives \
    /usr/share/centreon/bin/centreonSyncPlugins \
    /usr/share/centreon/bin/centreon_trap_send \
    /usr/share/centreon/bin/export-mysql-indexes \
    /usr/share/centreon/bin/generateSqlLite \
    /usr/share/centreon/bin/import-mysql-indexes \
    /usr/share/centreon/bin/logAnalyserBroker \
    /usr/share/centreon/cron/centreon-backup.pl \
    /usr/share/centreon/cron/dashboardBuilder \
    /usr/share/centreon/cron/eventReportBuilder \
    /usr/share/centreon/vendor/enshrined/svg-sanitize/src/svg-scanner.php \
    /usr/share/centreon/www/install/tools/migration/logsMigration.pl


  if [ -f "/usr/bin/pear" ]; then
46
    /usr/bin/pear channel-update pear.php.net
47
48
49
50
51
52
53
54
    /usr/bin/pear install --force --alldeps db  >/dev/null
  fi


  if [ -f "/etc/init.d/cron" ]; then
      service cron restart
  fi

55
56
fi
exit 0