File: postrm

package info (click to toggle)
otrs2 2.2.7-2lenny3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,444 kB
  • ctags: 5,808
  • sloc: perl: 129,825; xml: 16,139; sql: 11,400; sh: 1,198; makefile: 31; php: 16
file content (47 lines) | stat: -rw-r--r-- 1,010 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
45
46
47
#!/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
  rm -rf /usr/share/otrs
fi

#DEBHELPER#

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