summaryrefslogtreecommitdiff
path: root/debian/fingerd.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/fingerd.postinst')
-rw-r--r--debian/fingerd.postinst33
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/fingerd.postinst b/debian/fingerd.postinst
new file mode 100644
index 0000000..afe09b7
--- /dev/null
+++ b/debian/fingerd.postinst
@@ -0,0 +1,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#