summaryrefslogtreecommitdiff
path: root/debian/fingerd.postinst
blob: afe09b7c17dd548480817f9686ece980388b554e (plain)
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
#!/bin/sh

set -e

enable_if_alone() {
	if ! grep -q ^finger /etc/inetd.conf; then
		update-inetd --pattern /usr/sbin/in\\.fingerd --enable finger
	fi
}

case "$1" in
abort-upgrade | abort-deconfigure | abort-remove)
	enable_if_alone
	;;
configure)
	if [ -n "$2" ]; then
		enable_if_alone
	else
		fingerentry="finger		stream	tcp	nowait	nobody	/usr/sbin/tcpd	/usr/sbin/in.fingerd"
		if grep -q ^finger /etc/inetd.conf; then
			update-inetd --group INFO --add "#$fingerentry"
		else
			update-inetd --group INFO --add "$fingerentry"
		fi
	fi
	;;
*)
	printf "$0: incorrect arguments: $*\n" >&2
	exit 1
	;;
esac

#DEBHELPER#