File: config

package info (click to toggle)
nullmailer 1.00RC7-22
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,192 kB
  • ctags: 695
  • sloc: cpp: 4,375; sh: 519; makefile: 249; perl: 184; ansic: 10
file content (41 lines) | stat: -rw-r--r-- 703 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
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

set -e

. /usr/share/debconf/confmodule
db_version 2.0
db_capb backup

db_get shared/mailname
if [ -z "$RET" ]; then
	if [ -e /etc/mailname ]; then
		db_set shared/mailname "`cat /etc/mailname`"
	else
		db_set shared/mailname "`hostname --fqdn`"
	fi
fi

db_get nullmailer/relayhost
if [ -z "$RET" ]; then
	db_set nullmailer/relayhost "mail.`hostname --domain`"
fi

state=1
while [ "$state" -ge 1 -a "$state" -le 3 ]; do
	case "$state" in
	1)	db_input high shared/mailname || true
		;;
	2)	db_input high nullmailer/relayhost || true
		;;
	3)	db_input medium nullmailer/adminaddr || true
		;;
	esac
	if db_go; then
		state=$(($state + 1))
	else
		state=$(($state - 1))
	fi
done

db_stop
exit 0