File: postrm

package info (click to toggle)
ndtpd 2.3.6-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,688 kB
  • ctags: 3,377
  • sloc: ansic: 24,078; sh: 7,530; perl: 1,335; makefile: 646
file content (39 lines) | stat: -rw-r--r-- 805 bytes parent folder | download
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
#!/bin/sh

set -e

update-inetd --remove ndtpd

# default facility
facility=local0
logfile=/var/log/ndtpd.log

syslogline="$facility.info $logfile"
restartsyslog=0

if grep "^$syslogline$" /etc/syslog.conf > /dev/null; then
   echo "Removing 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
   restartsyslog=1
fi

case "$restartsyslog" in
 1)
    if [ -x /etc/init.d/sysklogd ]; then
        /etc/init.d/sysklogd restart
    fi
    ;;
esac

if grep -q ^ndtpd: /etc/passwd; then
  if [ -x /usr/bin/ypwhich ]; then
    ypmatch ndtpd passwd 2>&1 | grep -q ^ndtpd: || userdel -r ndtpd
  else
    userdel -r ndtpd
  fi
fi


#DEBHELPER#