]> the.earth.li Git - onak.git/blob - debian/postinst
f821f40ed00cc879ddc3bb9f31ef415b0868632d
[onak.git] / debian / postinst
1 #! /bin/sh
2
3 set -e
4
5 if [ "$1" = "configure" ]; then
6
7     # Add the onak user
8     adduser --system --home /var/lib/onak --no-create-home --disabled-login onak
9
10     # 
11     # If there's no onak database, create it by adding my key.
12     #
13     if [ ! -e /var/lib/onak/num_keydb ]; then
14         zcat /usr/share/doc/onak/noodles.key | onak -b add
15     fi
16
17     # Take ownership of the database directory
18     chown -R onak /var/lib/onak
19
20     # Create our logfile
21     touch /var/log/onak.log
22     chown onak /var/log/onak.log
23
24     # Make the CGI tools setuid onak
25     for i in /usr/lib/cgi-bin/pks/*
26     do
27         if ! dpkg-statoverride --list $i >/dev/null
28         then
29             dpkg-statoverride --update --add onak root 4755 $i
30         fi
31     done
32 fi