Correct date on changelog entry
[trust_router.git] / debian / moonshot-trust-router.postinst
1 #!/bin/sh
2
3 set -e
4
5 # summary of how this script can be called:
6 #        * <postinst> `configure' <most-recently-configured-version>
7 #        * <old-postinst> `abort-upgrade' <new version>
8 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
9 #          <new-version>
10 #        * <postinst> `abort-remove'
11 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
12 #          <failed-install-package> <version> `removing'
13 #          <conflicting-package> <version>
14 # for details, see http://www.debian.org/doc/debian-policy/ or
15 # the debian-policy package
16
17
18 case "$1" in
19     configure)
20         if dpkg --compare-versions "$2" lt 1.2-2; then
21             adduser --quiet --system --home /var/lib/trust_router --group --disabled-login trustrouter
22         fi
23         if dpkg --compare-versions "$2" lt-nl 1.5.1 ; then
24             # Schema updated
25             rm -f /var/lib/trust_router/keys
26         fi
27         su -s /bin/sh  -c "umask 027&&sqlite3 </usr/share/trust_router/schema.sql /var/lib/trust_router/keys" trustrouter ||true
28     ;;
29
30     abort-upgrade|abort-remove|abort-deconfigure)
31     ;;
32
33     *)
34         echo "postinst called with unknown argument \`$1'" >&2
35         exit 1
36     ;;
37 esac
38
39 # dh_installdeb will replace this with shell code automatically
40 # generated by other debhelper scripts.
41
42 #DEBHELPER#
43
44 exit 0