This file is indexed.

postinst is in ocsinventory-reports 2.1.2-1ubuntu1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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
46
47
48
#!/bin/sh
# postinst script for ocsinventory-reports
#
# see: dh_installdeb(1)

set -e

pkgpath="/usr/share/ocsinventory-reports"
varpath="/var/lib/ocsinventory-reports"
dbconfpath="/etc/ocsinventory/dbconfig.inc.php"

# Allow php to write there
for dirname in ipd download snmp; do
 chown -R www-data:www-data $varpath/$dirname
 chmod -R g+w               $varpath/$dirname
done

for dirname in $pkgpath; do
 chown -R www-data:www-data $dirname
done 

if [ "$1" = "configure" ]; then
  # create empty /etc/ocsinventory/dbconfig.inc.php if missing
  if [ ! -e $dbconfpath ]; then
    cat << EOS > $dbconfpath
<?php

?>
EOS
  fi

  # Allow php to update it
  chown www-data:www-data $dbconfpath
fi

# Automatically added by dh_apache2
if true; then
	if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
		. /usr/share/apache2/apache2-maintscript-helper
		for conf in ocsinventory-reports  ; do
			apache2_invoke enconf $conf  || exit $?
		done
	fi
fi
# End automatically added section


exit 0