This file is indexed.

postinst is in prelude-manager 1.0.1-3.

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
#!/bin/sh

set -e

add_sysuser()
{
	if ! getent passwd prelude >/dev/null; then
		adduser --system --disabled-login --no-create-home --group prelude 2>&1 > /dev/null
	fi
}

add_sysuser

if [ "$1" = "configure" ]; then
  confpath="/etc/prelude-manager"
  conffile="${confpath}/prelude-manager.conf"
  confnew="${conffile}-new"
  pkgpath="/usr/share/prelude-manager"

  . /usr/share/debconf/confmodule
  . /usr/share/dbconfig-common/dpkg/postinst
  dbc_first_version="0.9.8-3"

  dbc_go prelude-manager $@

  cp $conffile $confnew

  if [ -z "$dbc_dbserver" ]; then
    dbc_dbserver=localhost
  fi
  if [ -z "$dbc_dbport" ]; then
    if [ "$dbc_dbtype" = "mysql" ]; then
      dbc_dbport=3306
    else
      if [ "$dbc_dbtype" = "pgsql" ]; then
        dbc_dbport=5432
      fi
    fi
  fi

  if [ -n "$dbc_dbtype" ]; then
    sed -i -e "s/@DBC_TYPE@/$dbc_dbtype/" \
    -e "s/@DBC_HOST@/$dbc_dbserver/" \
    -e "s/@DBC_PORT@/$dbc_dbport/" \
    -e "s/@DBC_NAME@/$dbc_dbname/" \
    -e "s/@DBC_USER@/$dbc_dbuser/" \
    -e "s/@DBC_PASS@/$dbc_dbpass/" \
    $confnew

    # Installing the config
    if diff -q /usr/share/doc/prelude-manager/examples/prelude-manager.conf $conffile >/dev/null 2>&1; then
      # configure file has not been changed .. overwrite it
      cp $confnew $conffile
    else
      ucf --three-way --debconf-ok $confnew $conffile
    fi
  fi

  # make sure conf file has the correct permissions and owner/group
  chmod 640 /etc/prelude-manager/prelude-manager.conf
  chown prelude /etc/prelude-manager/prelude-manager.conf

  rm -f $confnew

  db_stop

  # run this command before starting initscripts

  chown -R prelude:prelude /var/spool/prelude-manager/ >/dev/null

  PROFILE_NAME="prelude-manager"
  if [ -x "/usr/bin/prelude-admin" ]; then
    if [ ! -d "/etc/prelude/profile/$PROFILE_NAME" ]; then
      prelude-admin add prelude-manager --uid prelude --gid prelude
      prelude-admin chown prelude-manager --uid prelude --gid prelude
    fi
  fi

fi


# Automatically added by dh_installinit
if [ -x "/etc/init.d/prelude-manager" ]; then
	update-rc.d prelude-manager defaults >/dev/null
	invoke-rc.d prelude-manager start || exit $?
fi
# End automatically added section


exit 0