Code

prepared new upstream release
[pkg-nagvis.git] / debian / postinst
index 31e91d20af82d0f6ba5378ec1785d163e92ae9f1..761d1b2828390f8367c5ba0f46a7133542220d83 100644 (file)
@@ -8,12 +8,11 @@ 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='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/config.ini.php.dist'
+       dbc_generate_include_args='--ucf -C\; -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>
@@ -27,7 +26,7 @@ db_stop
 # 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"
@@ -38,6 +37,8 @@ setperm() { # thx 2 nagios2/debian/nagios2-common.postinst
                chown "$user":"$group" "$file"
                chmod "$mode" "$file"
        fi
+
+               
 }
 
 case "$1" in
@@ -46,8 +47,14 @@ case "$1" in
                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/images/maps
        setperm www-data www-data 0775 /usr/share/nagvis/htdocs/nagvis/etc/maps
+       setperm www-data www-data 0755 /var/lib/nagvis
+
+       ucf /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
+
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
@@ -59,6 +66,7 @@ case "$1" in
     ;;
 esac
 
+db_stop
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.