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 ]; then
17 zcat /usr/share/doc/onak/noodles.key | onak -b add
20 # Take ownership of the database and spool directory
21 chown -R onak /var/lib/onak
22 chown -R onak /var/spool/onak
25 touch /var/log/onak.log
26 chown onak /var/log/onak.log
28 # Make the CGI tools setuid onak
29 for i in /usr/lib/cgi-bin/pks/*
31 if ! dpkg-statoverride --list $i >/dev/null
33 dpkg-statoverride --update --add onak root 4755 $i
37 # If we don't have a DB backend defined, then add appropriate config
38 if ! grep -q db_backend /etc/onak.conf; then
39 echo "# Auto added on package update" >> /etc/onak.conf
40 echo "backends_dir /usr/lib/onak/backends" >> /etc/onak.conf
41 echo "db_backend db4" >> /etc/onak.conf
44 # If we still have the old default mail_dir setting, fix it
45 if grep -q "mail_dir /community/pgp-keyserver/incoming" /etc/onak.conf; then
46 sed -i.bak "s/community\/pgp-keyserver\/incoming/var\/spool\/onak/" \