File: postrm

package info (click to toggle)
ntop 3:3.3-11
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 12,772 kB
  • ctags: 7,534
  • sloc: ansic: 71,427; sh: 16,772; awk: 1,504; perl: 792; makefile: 782; php: 123; python: 23; sql: 13; sed: 11
file content (44 lines) | stat: -rw-r--r-- 792 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
40
41
42
43
44
#!/bin/sh -e

if [ "$1" = "purge" ] ; then

  # source debconf library
if [ -f  /usr/share/debconf/confmodule ] ; then
    . /usr/share/debconf/confmodule
fi

  INIT="/etc/ntop/init.cfg"
  if [ -f $INIT ] ; then
    # parse config file for user
if [ -f "$INIT" ] ; then
    . $INIT
fi

    # remove user
    if grep -q ^$USER: /etc/passwd; then
      db_get ntop/createuser
      CREATEUSER=$RET
      if [ "$CREATEUSER" = "true" ]; then
        deluser $USER;
      fi
    fi
  fi

  # Remove init.cfg file and dir
  if [ -d /etc/ntop ] ; then
    rm -rf /etc/ntop;
  fi
  # remove stored data
  if [ -d /var/lib/ntop ] ; then
    rm -rf /var/lib/ntop;
  fi
  if [ -d /var/log/ntop ] ; then
    rm -rf /var/log/ntop;
  fi

  db_purge

  update-rc.d -f ntop remove >/dev/null
fi

#DEBHELPER#