This file is indexed.

preinst is in ebnetd-common 1:1.0.dfsg.1-4.3.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
# preinst script for ebnetd-common
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    install|upgrade)

    #
    # Remove leftover of the previous packaging
    #
    facility=local0
    logfile=/var/log/ndtpd.log

    syslogline="$facility.info $logfile"

    # Left by ancient versions
    if grep "^# Added by ndtpd package" /etc/syslog.conf > /dev/null; then
      echo "Removing really old ndtpd's entry from syslog.conf"
      sed '/^# Added by ndtpd package/,/^"$syslogline"/D' < /etc/syslog.conf > /etc/syslog.conf.new
      mv -f /etc/syslog.conf /etc/syslog.conf.old
      mv -f /etc/syslog.conf.new /etc/syslog.conf
    fi

    # Left by relatively new versions
    if grep "^local[0-7].info		$logfile" /etc/syslog.conf > /dev/null; then
      echo "Removing old ndtpd's entry from syslog.conf"
      sed '/^local[0-7].info.*ndtpd.log$/D' < /etc/syslog.conf > /etc/syslog.conf.new
      mv -f /etc/syslog.conf /etc/syslog.conf.old
      mv -f /etc/syslog.conf.new /etc/syslog.conf
    fi

    # Remove the user ndtpd
    id ndtpd > /dev/null 2>&1 && userdel -r ndtpd || true
    
    # For upgrading from the old ndtpd (<= 3.1.5)
    if [ -d /etc/ndtpd ]; then
	install -d /etc/ebnetd/book.d
	cp /etc/ndtpd/book.d/* /etc/ebnetd/book.d
        rm -f /etc/ebnetd/book.d/00ndtpd
	rm -f /etc/cron.daily/ndtpd
	rm -rf /etc/ndtpd
    fi

    rm -f /etc/syslog.conf.old

    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0