File: postinst

package info (click to toggle)
asp 1.8-8
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 268 kB
  • sloc: ansic: 1,069; sh: 191; makefile: 143
file content (41 lines) | stat: -rw-r--r-- 821 bytes parent folder | download | duplicates (3)
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

INETDCONF=/etc/inetd.conf
INETDENTRY="asp		dgram	udp	wait	nobody	/usr/sbin/tcpd	/usr/sbin/in.aspd"

case "$1" in
    configure)
	if [ -x /usr/sbin/update-inetd ]; then
	    if grep -q '^asp' $INETDCONF ; then
	        ENABLED=yes
	    else
	        ENABLED=no
	    fi
	    
	    # remove legacy entry:
	    if grep -q "^#$INETDENTRY" $INETDCONF ; then
	        update-inetd --remove asp
	    fi

	    if [ "$ENABLED" = "yes" ]; then
		update-inetd --add "$INETDENTRY"
	    else
	        update-inetd --add "#<off># $INETDENTRY"
	    fi
	fi
        ;;
    abort-upgrade|abort-remove|abort-deconfigure)
	if [ -x /usr/sbin/update-inetd ]; then
	    update-inetd --remove asp
	fi
        ;;
    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
        ;;
esac

#DEBHELPER#