Debian Codegraph @

debian/postinst

raw
1 #!/bin/sh -e
2 # postinst script for biff
3 # Configures comsat inetd entry if inetd is present.
4 # Warns and skips configuration if xinetd is detected.
5
6 case "$1" in
7 configure)
8 if command -v update-inetd >/dev/null 2>&1; then
9 if [ -f /etc/inetd.conf ]; then
10 # Standard inetd setup
11 if grep -q '^biff' /etc/inetd.conf ; then
12 ENABLED=yes
13 else
14 ENABLED=no
15 fi
16
17 if grep -q 'biff[[:space:]]\+dgram[[:space:]]\+udp[[:space:]]\+wait[[:space:]]\+nobody\.mail[[:space:]]\+/usr/sbin/in\.comsat[[:space:]]\+comsat' /etc/inetd.conf ; then
18 update-inetd --remove biff
19 fi
20
21 if [ "$ENABLED" = "yes" ]; then
22 update-inetd --add 'biff dgram udp wait root.tty /usr/sbin/in.comsat comsat'
23 else
24 update-inetd --add '#<off># biff dgram udp wait root.tty /usr/sbin/in.comsat comsat'
25 fi
26
27 elif [ -d /etc/xinetd.d ] || [ -f /etc/xinetd.conf ]; then
28 echo "Warning: xinetd detected, but this package only supports inetd (/etc/inetd.conf)." >&2
29 echo "Skipping biff (comsat) configuration." >&2
30 else
31 echo "No /etc/inetd.conf found — no inetd detected, skipping comsat setup." >&2
32 fi
33 fi
34 ;;
35 esac
36
37 #DEBHELPER#
38