3
3
. /usr/share/debconf/confmodule
5
# (taken from the webapps-common httpd functions)
6
# wc_httpd_installed: test for installed httpds
8
# wc_httpd_installed [ httpd1 httpd2 ... ]
10
# no arguments implies to test for all servers
5
db_fget nagios3/adminpassword seen || true
8
if [ "$1" = "reconfigure" ]; then
12
if [ "$rootpassword_seen" != "true" ]; then
13
while [ ! "$passwordsmatch" ]; do
14
db_input high nagios3/adminpassword || true
15
db_input high nagios3/adminpassword-repeat || true
17
db_get nagios3/adminpassword
19
db_get nagios3/adminpassword-repeat
21
if [ "$p1" = "$p2" ]; then
16
httpds=$wc_httpd_supported
24
db_fset nagios3/adminpassword seen false
25
db_fset nagios3/adminpassword-repeat seen false
26
db_fset nagios3/adminpassword-mismatch seen false
27
db_input critical nagios3/adminpassword-mismatch || true
19
if test -x /usr/sbin/$f; then
26
# list of installed servers to check for
27
default_servers=`wc_httpd_installed apache2 apache apache-ssl apache-perl`
28
# convert list to comma seperated list
29
server_list=`echo $default_servers | sed -e 's/[[:space:]][[:space:]]*/, /g'`
31
# if they haven't already been prompted, preseed the server selection
32
db_fget nagios3/httpd seen
33
if [ "$RET" = "false" ]; then
34
db_set nagios3/httpd $server_list
37
db_input medium nagios3/httpd || true
42
if [ "$keepgoing" ]; then
43
db_input medium nagios3/nagios1-in-apacheconf || true
45
# the passwords are reset at the end of every postinst run,
46
# however, they are left in the "seen" state so that the
47
# admin is not prompted for them at every upgrade.
48
while [ ! "$passwordsmatch" ]; do
49
#only ask for a password if no htpasswd exists
50
test -f /etc/nagios3/htpasswd.users && break
51
db_input high nagios3/adminpassword || true
52
db_input high nagios3/adminpassword-repeat || true
54
db_get nagios3/adminpassword
56
db_get nagios3/adminpassword-repeat
58
if [ "$p1" = "$p2" ]; then
61
db_fset nagios3/adminpassword seen false
62
db_fset nagios3/adminpassword-repeat seen false
63
db_fset nagios3/adminpassword-mismatch seen false
64
db_input critical nagios3/adminpassword-mismatch || true