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