Imported Debian patch 3.0.715-1
[darkstat-debian] / debian / postinst
1 #! /bin/sh
2 # postinst script for darkstat
3
4 . /usr/share/debconf/confmodule
5  
6 set -e
7
8 case "$1" in
9     configure)
10         if [ "$2" != "" ]; then
11         if dpkg --compare-versions "$2" lt "3.0.707-1"; then
12                 # If the user answer "No" at the debconf question db_purge-2.5-1
13                 # we don't come here
14                 dbfile="/var/lib/darkstat/darkstat.db"
15                 if [ -f $dbfile ]; then
16                     echo -n "Removing darkstat database file $dbfile..."
17                     rm -f $dbfile
18                     echo "done."
19                 fi
20             fi
21         fi
22         chown -R nobody /var/lib/darkstat           
23     ;;
24  
25     abort-upgrade|abort-remove|abort-deconfigure)
26  
27     ;;
28  
29     *)
30         echo "postinst called with unknown argument \`$1'" >&2
31         exit 1
32     ;;
33 esac
34
35 #DEBHELPER#
36
37 exit 0