#! /bin/sh # postinst script for depview # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. # source debconf library . /usr/share/debconf/confmodule CFG=/var/www/depview/include/config.inc.php set_line() { echo "$@" >> $CFG; } case "$1" in configure) rm -f $CFG db_get depview/db_host db_host="$RET" db_get depview/db_db db_db="$RET" db_get depview/db_user db_user="$RET" db_get depview/db_passwd db_passwd="$RET" set_line "" chgrp www-data $CFG chmod o-r $CFG ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0