File: postsrsd.config

package info (click to toggle)
postsrsd 2.0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 572 kB
  • sloc: ansic: 4,084; python: 385; sh: 99; makefile: 16
file content (28 lines) | stat: -rwxr-xr-x 705 bytes parent folder | download
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
#!/bin/sh

CONFIGFILE=/etc/postsrsd.conf
set -e
. /usr/share/debconf/confmodule

if [ -e $CONFIGFILE ]; then
	DOMAIN=$(grep -Po '(?<=^domains = { ")[^"]+' $CONFIGFILE) || true
	db_set postsrsd/domain "$DOMAIN"
	priority="medium"
else
	# only set the default value if the current value is empty, especially
	# important since we can get called twice before the postinst writes
	# the config file.
	db_get postsrsd/domain
	DOMAIN="$RET"

	if [ -z "$DOMAIN" -a -e /usr/sbin/postconf ]; then
		db_set postsrsd/domain "$(postconf -h mydomain)"
		priority="medium"
	elif [ -z "$DOMAIN" ]; then
		db_set postsrsd/domain "$(hostname -d)"
		priority="high"
	fi
fi

db_input $priority postsrsd/domain || true
db_go