File: postrm

package info (click to toggle)
otrs2 2.0.4p01-18
  • links: PTS
  • area: main
  • in suites: etch
  • size: 7,900 kB
  • ctags: 4,437
  • sloc: perl: 81,607; xml: 8,135; sql: 8,013; sh: 1,113; makefile: 22; php: 16
file content (44 lines) | stat: -rw-r--r-- 940 bytes parent folder | download | duplicates (2)
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

set -e

CONFIGFILES="Kernel/Config.pm Kernel/Config/GenericAgent.pm maintainance.html"

purge_conffile()
{
  if [ -x /usr/bin/ucf ]; then
    ucf --purge $1
  fi
  rm -f $1 $1.dpkg-* $1.ucf-*
}

. /usr/share/debconf/confmodule

if [ -e /usr/share/dbconfig-common/dpkg/postrm ]; then
  . /usr/share/dbconfig-common/dpkg/postrm
  dbc_go otrs2 "$@"
fi

if [ "$1" = purge ]; then
  deluser otrs || true
  # Remove possible remainings from working as otrs user
  rm -f /usr/share/otrs/.*history
  # Remove log and tmp files
  rm -rf /var/lib/otrs/log /var/lib/otrs/tmp
  for FILE in $CONFIGFILES; do
    purge_conffile /etc/otrs/$FILE
  done
  purge_conffile /etc/otrs/cron
  purge_conffile /etc/otrs/fetchmailrc
  purge_conffile /etc/apache2/conf.d/otrs2
  purge_conffile /etc/otrs/database.pm
  rm -f /var/lib/otrs/httpd/htdocs/maintainance.html
fi

#DEBHELPER#

if [ "$1" = purge ]; then
  db_stop
  invoke-rc.d apache2 reload
fi