#!/bin/sh # postinst script for nagvis # # see: dh_installdeb(1) set -e . /usr/share/debconf/confmodule if [ -f /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql ]; then . /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql dbc_generate_include='template:/etc/nagvis/config.ini.php' dbc_generate_include_owner='www-data:www-data' dbc_generate_include_args='--ucf -o template_infile=/usr/share/nagvis/debian/config.ini.php.dist' dbc_go nagvis $@ fi db_stop # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package setperm() { # thx 2 nagios2/debian/nagios2-common.postinst local user="$1" local group="$2" local mode="$3" local file="$4" shift 4 # only do something when no setting exists if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then chown "$user":"$group" "$file" chmod "$mode" "$file" fi } case "$1" in configure) for f in `find /usr/share/nagvis/htdocs -type f -o -type d 2>/dev/null`; do test -f $f && setperm www-data www-data 0644 $f test -d $f && setperm www-data www-data 0755 $f done setperm www-data www-data 0775 /usr/share/nagvis/htdocs/nagvis/etc/maps ucf /usr/share/nagvis/debian/apache.conf /etc/nagvis/apache.conf #if ! [ -e /etc/apache2/conf.d/nagvis.conf ]; then # ln -s /etc/nagvis/apache.conf /etc/apache2/conf.d/nagvis.conf #fi ;; 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