5 if [ "$1" = "configure" ]; then
8 adduser --system --home /var/lib/onak --no-create-home --disabled-login onak
11 # If there's no onak database, create it by adding my key.
13 if [ ! -e /var/lib/onak/num_keydb ]; then
14 zcat /usr/share/doc/onak/noodles.key | onak -b add
17 # Take ownership of the database and spool directory
18 chown -R onak /var/lib/onak
19 chown -R onak /var/spool/onak
22 touch /var/log/onak.log
23 chown onak /var/log/onak.log
25 # Make the CGI tools setuid onak
26 for i in /usr/lib/cgi-bin/pks/*
28 if ! dpkg-statoverride --list $i >/dev/null
30 dpkg-statoverride --update --add onak root 4755 $i
34 # If we don't have a DB backend defined, then add appropriate config
35 if ! grep -q db_backend /etc/onak.conf; then
36 echo "# Auto added on package update" >> /etc/onak.conf
37 echo "backends_dir /usr/lib/onak/backends" >> /etc/onak.conf
38 echo "db_backend db4" >> /etc/onak.conf
41 # If we still have the old default mail_dir setting, fix it
42 if grep -q "mail_dir /community/pgp-keyserver/incoming" /etc/onak.conf; then
43 sed -i.bak "s/community\/pgp-keyserver\/incoming/var\/spool\/onak/" \