~ubuntu-branches/ubuntu/vivid/lurker/vivid

« back to all changes in this revision

Viewing changes to debian/postrm

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Meurer
  • Date: 2006-12-20 05:05:31 UTC
  • mfrom: (3.1.6 feisty)
  • Revision ID: james.westby@ubuntu.com-20061220050531-79inzy7o6uu95qx7
Tags: 2.1-7
* updated vi debconf translations, thanks to Clytie Siddall
  <clytie@riverland.net.au>
* fixed typo in one template (that you would like, not that
  would you like), thanks as well to Clytie Siddall
  - unfuzzied all translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
set -e
7
7
 
 
8
# debhelper stuff
 
9
#DEBHELPER#
 
10
 
8
11
case "$1" in
9
12
  remove)
10
 
    for server in apache apache-ssl apache-perl; do
11
 
      if [ -f /etc/$server/conf.d/lurker -a -h /etc/$server/conf.d/lurker ]; then
12
 
        # remove symlinks
13
 
        echo "Removing lurker relating $server config."
 
13
    for server in apache apache-ssl apache-perl apache2; do
 
14
      if [ -f /etc/$server/conf.d/lurker ] || [ -h /etc/$server/conf.d/lurker ]; then
 
15
        echo "Removing the lurker $server configuration."
14
16
        rm -f /etc/$server/conf.d/lurker
15
17
 
16
18
        # restart server
17
 
        if [ -x /usr/sbin/invoke-rc.d ]; then
18
 
            invoke-rc.d $server restart
19
 
        else
20
 
            /etc/init.d/$server restart
21
 
        fi
 
19
        restart="$restart $server"
22
20
      fi
23
21
    done
 
22
 
 
23
    for server in $restart; do
 
24
      invoke-rc.d $server restart
 
25
    done
24
26
  ;;
25
27
 
26
28
  purge)
27
 
    sg lurker -c true 2> /dev/null && groupdel lurker
28
 
 
29
 
    ucf --purge /etc/lurker/lurker.conf
30
 
    rm -rf /etc/lurker /var/www/lurker /var/lib/lurker
 
29
    # remove the systemgroup lurker
 
30
    # sg lurker -c true 2> /dev/null && groupdel lurker
 
31
    LURKER_GROUP=lurker
 
32
    if [ -r /etc/adduser.conf ]; then
 
33
      FIRST_SYSTEM_GID=`grep ^FIRST_SYSTEM_GID /etc/adduser.conf | cut -f2 -d '='`
 
34
      LAST_SYSTEM_GID=`grep ^LAST_SYSTEM_GID /etc/adduser.conf | cut -f2 -d '='`
 
35
    else
 
36
      FIRST_SYSTEM_GID=100
 
37
      LAST_SYSTEM_GID=199
 
38
    fi
 
39
    if [ -n "$FIRST_SYSTEM_GID" ] && [ -n "$LAST_SYSTEM_GID" ]; then
 
40
      if GROUPGID=`getent group $LURKER_GROUP | cut -f 3 -d ':'`; then
 
41
        if [ -n "$GROUPGID" ]; then
 
42
          if [ "$LAST_SYSTEM_GID" -gt "$GROUPGID" ] && [ "$FIRST_SYSTEM_GID" -lt "$GROUPGID" ]; then
 
43
            echo -n "Removing $LURKER_GROUP group .."
 
44
            groupdel $LURKER_GROUP
 
45
            echo "..done"
 
46
          fi  
 
47
        fi
 
48
      fi
 
49
    fi
 
50
 
 
51
    echo "Removing lurker configuration and database."
 
52
 
 
53
    # remove the configuration file itself
 
54
    rm -f /etc/lurker/lurker.conf
 
55
 
 
56
    # and finally clear it out from the ucf database
 
57
    if [ -x /usr/bin/ucf ]; then
 
58
      /usr/bin/ucf --purge /etc/lurker/lurker.conf
 
59
    fi
 
60
    
 
61
    rm -rf /var/lib/lurker
31
62
  ;;
32
63
  
33
64
  upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
39
70
  ;;
40
71
esac
41
72
 
42
 
# dh_installdeb will replace this with shell code automatically
43
 
# generated by other debhelper scripts.
44
 
 
45
 
#DEBHELPER#
46
 
 
47
73
exit 0