This file is indexed.

postinst is in ldap-account-manager 5.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
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash

set -e

. /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ]

cd /usr/share/ldap-account-manager/config-samples/profiles
files=`ls -a default.*`
for file in $files; do
	if [ ! -f /var/lib/ldap-account-manager/config/templates/profiles/$file ]; then
		cp $file /var/lib/ldap-account-manager/config/templates/profiles/$file
	fi
done
cd /usr/share/ldap-account-manager/config-samples/pdf
files=`ls -a default.*`
for file in $files; do
	if [ ! -f /var/lib/ldap-account-manager/config/templates/pdf/$file ]; then
		cp $file /var/lib/ldap-account-manager/config/templates/pdf/$file
	fi
done
cd /usr/share/ldap-account-manager/config-samples/pdf/logos
files=`ls -a *.jpg`
for file in $files; do
	cp $file /var/lib/ldap-account-manager/config/templates/pdf/logos/$file
done
if [ ! -h /usr/share/ldap-account-manager/lib/fpdf.php ]; then\
  ln -s /usr/share/fpdf/fpdf.php /usr/share/ldap-account-manager/lib/fpdf.php; fi
if [ ! -h /usr/share/ldap-account-manager/config ]; then\
  ln -s /var/lib/ldap-account-manager/config /usr/share/ldap-account-manager/config; fi
if [ ! -h /usr/share/ldap-account-manager/sess ]; then\
  ln -s /var/lib/ldap-account-manager/sess /usr/share/ldap-account-manager/sess; fi
if [ ! -h /usr/share/ldap-account-manager/tmp ]; then\
  ln -s /var/lib/ldap-account-manager/tmp /usr/share/ldap-account-manager/tmp; fi
chown www-data /etc/ldap-account-manager/config.cfg
chmod 600 /etc/ldap-account-manager/config.cfg
chown www-data /var/lib/ldap-account-manager/sess
chmod 700 /var/lib/ldap-account-manager/sess
chown www-data /var/lib/ldap-account-manager/tmp
chown www-data /var/lib/ldap-account-manager/tmp/internal
chmod 700 /var/lib/ldap-account-manager/tmp
chown -R www-data /var/lib/ldap-account-manager/config
chmod 700 /var/lib/ldap-account-manager/config
if [ ! -f /var/lib/ldap-account-manager/config/lam.conf ]; \
   then cp /var/lib/ldap-account-manager/config/unix.conf.sample /var/lib/ldap-account-manager/config/lam.conf; \
	chown www-data /var/lib/ldap-account-manager/config/lam.conf; fi
chmod 600 /var/lib/ldap-account-manager/config/*.conf
if [ "$1" = "configure" ]; then
    db_get "ldap-account-manager/alias"
    alias="$RET"
	 perl -pi -e "s/Alias \/.* \/usr\/share\/ldap-account-manager/Alias \/$alias \/usr\/share\/ldap-account-manager/g"\
        /etc/ldap-account-manager/apache.conf
    db_get "ldap-account-manager/config-webserver"
    webservers="$RET"
    restart=""
   for server in $webservers; do
       server=${server%,}
       test -x /usr/sbin/$server || continue
       case "$server" in
           apache2)
               if [ -d /etc/$server/mods-enabled ] && [ -d /etc/$server/mods-available ]; then
                   if [ ! -f /etc/$server/mods-enabled/actions.load -a ! -h /etc/$server/mods-enabled/actions.load ]; then
                       ln -s /etc/$server/mods-available/actions.load /etc/$server/mods-enabled/actions.load
                   fi
                   if [ -f /etc/$server/mods-available/php.load ]; then
                       if [ ! -f /etc/$server/mods-enabled/php.load -a ! -h /etc/$server/mods-enabled/php.load ]; then
                           ln -s /etc/$server/mods-available/php.load /etc/$server/mods-enabled/php.load
                       fi
                   fi
                   if [ -f /etc/$server/mods-available/php.conf ]; then
                       if [ ! -f /etc/$server/mods-enabled/php.conf -a ! -h /etc/$server/mods-enabled/php.conf ]; then
                           ln -s /etc/$server/mods-available/php.conf /etc/$server/mods-enabled/php.conf
                       fi
                   fi
                   if [ -f /etc/$server/mods-available/version.load ]; then
                       if [ ! -f /etc/$server/mods-enabled/version.load -a ! -h /etc/$server/mods-enabled/version.load ]; then
                           ln -s /etc/$server/mods-available/version.load /etc/$server/mods-enabled/version.load
                       fi
                   fi
               fi
               if [ -d /etc/$server/conf.d -a ! -e /etc/$server/conf.d/ldap-account-manager ]; then
                   ln -s /etc/ldap-account-manager/apache.conf /etc/$server/conf.d/ldap-account-manager
                   restart="$restart $server"
               fi
               if [ -d /etc/$server/conf-available ] && [ -d /etc/$server/conf-enabled ]; then
                   if [ ! -e /etc/$server/conf-available/ldap-account-manager ]; then
                       ln -s /etc/ldap-account-manager/apache.conf /etc/$server/conf-available/ldap-account-manager.conf
                   fi
                   if [ ! -e /etc/$server/conf-enabled/ldap-account-manager.conf ]; then
                       ln -s ../conf-available/ldap-account-manager.conf /etc/$server/conf-enabled/ldap-account-manager.conf
                   fi
                   restart="$restart $server"
               fi
               ;;
       esac
   done
   db_get "ldap-account-manager/restart-webserver"
   if [ "$RET" = "true" ]; then
       for server in $restart; do
           server=${server%,}
           if [ `which invoke-rc.d` ]; then
               invoke-rc.d $server reload
           elif [ `which service` ]; then
               service $server reload
           elif [ `which systemctl` ]; then
               systemctl reload ${server}.service
           fi
       done
   fi
	fi



db_stop

exit 0