diff --git a/debian/postinst b/debian/postinst
index 384df73558064a6fbe6b4cc90bde2a29c978ed82..0a2093cb2106fa59fcd705e1c36f5503e048e42c 100644 (file)
--- a/debian/postinst
+++ b/debian/postinst
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/nagvis.ini.php'
- dbc_generate_include_owner='www-data:www-data'
- dbc_generate_include_args='--ucf -o template_infile=/usr/share/nagvis/debian/nagvis.ini.php-sample'
- dbc_go nagvis $@
-fi
-db_stop
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
-setperm() { # thx 2 nagios2/debian/nagios2-common.postinst
+setperm() {
local user="$1"
local group="$2"
local mode="$3"
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
+ setperm www-data www-data 0775 /etc/nagvis/maps
+ setperm www-data www-data 0755 /var/lib/nagvis
+ setperm www-data www-data 0755 /var/lib/nagvis/images
+ setperm www-data www-data 0755 /var/lib/nagvis/images/maps
+ setperm www-data www-data 0755 /var/cache/nagvis
- ucf /usr/share/nagvis/debian/apache.conf /etc/nagvis/apache.conf
- #if ! [ -e /etc/apache2/conf.d/nagvis.conf ]; then
+ ucf --debconf-ok /usr/share/nagvis/debian/apache.conf /etc/nagvis/apache.conf
+ #if [ ! -f /etc/apache2/conf.d/nagvis.conf ]; then
# ln -s /etc/nagvis/apache.conf /etc/apache2/conf.d/nagvis.conf
#fi
+ monitoring=$(db_get nagvis/monitoring_system)
+ echo "Will configure nagvis to use $monitoring"
+
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
esac
+db_stop
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.