1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
db_settitle dokuwiki/title
db_input low dokuwiki/system/configure-webserver || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/system/documentroot || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/system/accessible || true
db_go
db_settitle dokuwiki/title
db_input high dokuwiki/system/localnet|| true
db_go
db_settitle dokuwiki/title
db_input high dokuwiki/system/purgepages || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/system/writeconf || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/system/writeplugins || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/wiki/title || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/wiki/license || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/wiki/acl || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/system/documentroot || true
db_go
if [ ! -e /var/lib/dokuwiki/acl/users.auth.php ]
then
db_settitle dokuwiki/title
db_input low dokuwiki/wiki/superuser || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/wiki/fullname || true
db_go
db_settitle dokuwiki/title
db_input low dokuwiki/wiki/email || true
db_go
db_fget dokuwiki/wiki/password seen || true
PASSWORD_SEEN="${RET}"
case "${1}" in
reconfigure)
PASSWORD_SEEN="false"
;;
esac
case "${PASSWORD_SEEN}" in
true)
;;
*)
# TODO:
# currently, the dokuwiki package does not yet support
# /var/lib/dokuwiki to be removed and then automatically
# repopulated by dpkg-reconfigure.
#
# once this is implemented this will allow to do a
# "factory reset" of the package.
#
# for this the passwords need to be reset at the end of
# every postinst run. the password handling below is
# ready for that by leaving the debconf questions in
# "seen" state in order to only show them on
# reconfigure, instead of at any upgrade.
#
# this is currently ineffective because of the
# check of existence for users.auth.php.
while [ "${PASSWORD_MATCH}" != "true" ]
do
db_settitle dokuwiki/title
db_input high dokuwiki/wiki/password || true
db_go
db_settitle dokuwiki/title
db_input high dokuwiki/wiki/confirm || true
db_go
db_get dokuwiki/wiki/password
PASSWORD="${RET}"
db_get dokuwiki/wiki/confirm
CONFIRM="${RET}"
if [ -z "${PASSWORD}" ]
then
echo
echo "dokuwiki: no value for password preseeded or entered"
echo "dokuwiki: configuring no passwords now, please use 'dpkg-reconfigure dokuwiki'."
echo
break
fi
if [ -n "${PASSWORD}" ] && [ "${PASSWORD}" = "${CONFIRM}" ]
then
PASSWORD_MATCH="true"
else
db_fset dokuwiki/wiki/password seen false
db_go
db_fset dokuwiki/wiki/confirm seen false
db_go
db_settitle dokuwiki/title
db_input critical dokuwiki/wiki/failpass || true
db_go
fi
done
;;
esac
fi
if [ ! -e /var/lib/dokuwiki/acl/acl.auth.php ]
then
db_settitle dokuwiki/title
db_input low dokuwiki/wiki/policy || true
db_go
fi
db_stop
|