File: icinga-cgi.config

package info (click to toggle)
icinga 1.14.2+ds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 49,264 kB
  • sloc: ansic: 108,564; sql: 9,656; sh: 4,945; perl: 3,439; makefile: 1,213; php: 581; xml: 104
file content (35 lines) | stat: -rw-r--r-- 964 bytes parent folder | download | duplicates (4)
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
#!/bin/sh -e

. /usr/share/debconf/confmodule

db_fget icinga/adminpassword seen || true
password_seen="$RET"

if [ "$1" = "reconfigure" ]; then
    password_seen=false
fi

if [ "$password_seen" != "true" ]; then
	# the passwords are reset at the end of every postinst run,
	# however, they are left in the "seen" state so that the
	# admin is not prompted for them at every upgrade.
	while [ ! "$passwordsmatch" ]; do
		#only ask for a password if no htpasswd exists
		db_input high icinga/adminpassword || true
		db_input high icinga/adminpassword-repeat || true
		db_go || true
		db_get icinga/adminpassword
		p1="$RET"
		db_get icinga/adminpassword-repeat
		p2="$RET"
		if [ "$p1" = "$p2" ]; then
			passwordsmatch="yes"
		else
			db_fset icinga/adminpassword seen false
			db_fset icinga/adminpassword-repeat seen false
			db_fset icinga/adminpassword-mismatch seen false
			db_input critical icinga/adminpassword-mismatch || true
		fi
	done
fi
db_go || true