This file is indexed.

postinst is in chef-server-webui 10.12.0+dfsg-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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -e

. /usr/share/debconf/confmodule
. /etc/default/chef-server-webui

export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin

TEMPLATE=/usr/share/chef-server-webui/webui.rb
TMPDIR=`mktemp -d` # used for holding temp files
TMPFILE=`mktemp -p ${TMPDIR}` # used for holding rendered template
CONFIGFILE=/etc/chef/webui.rb

case "$1" in
  configure)
    db_get chef-server-webui/admin_password && chef_webui_pass="$RET"
		tsed=`mktemp -p ${TMPDIR}`
    cat << EOF > $tsed
s/^web_ui_admin_default_password \".*\"/web_ui_admin_default_password \"$chef_webui_pass\"/g
EOF
    if [ -n "$chef_webui_pass" ]; then
      sed -f $tsed $TEMPLATE > $TMPFILE
    fi
    ucf --debconf-ok $TMPFILE $CONFIGFILE
    test -f $CONFIGFILE && chmod 0640 $CONFIGFILE
    rm -rf $TMPDIR
    if ! getent passwd chef > /dev/null; then
      adduser --system --quiet \
        --home /var/lib/chef --no-create-home \
        --shell /bin/false --group --gecos "Chef Daemon" chef
    fi
    chown -R $USER:$GROUP /etc/chef
    chown -R $USER:$GROUP /var/lib/chef
    chown -R $USER:$GROUP /var/log/chef
    chown -R $USER:$GROUP /var/cache/chef
    chown -R $USER:$GROUP /var/run/chef
  ;;

  abort-upgrade|abort-remove|abort-deconfigure)
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

db_stop 

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

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


exit 0