postinst is in ocsinventory-reports 2.0.5-1.1.
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  | #!/bin/sh
# postinst script for ocsinventory-reports
#
# see: dh_installdeb(1)
set -e
pkgpath="/usr/share/ocsinventory-reports"
varpath="/var/lib/ocsinventory-reports"
confpath="/etc/ocsinventory"
conffile="ocsreports.conf"
# 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
  # enable required apache modules
  a2enmod php5
  a2enmod rewrite
 webserver="apache2"
      if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/$conffile ]; then
        ln -s $confpath/$conffile /etc/$webserver/conf.d/$conffile
      fi
if [ -f /etc/init.d/$webserver ] ; then
            if [ -x /usr/sbin/invoke-rc.d ]; then
                invoke-rc.d $webserver reload || true
            else
                /etc/init.d/$webserver reload || true
            fi
        fi
fi
exit 0
 |