File: postrm

package info (click to toggle)
cvsd 1.0.24
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 1,180 kB
  • sloc: sh: 5,075; ansic: 1,860; perl: 198; makefile: 88
file content (46 lines) | stat: -rw-r--r-- 1,143 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
45
46
#!/bin/sh

set -e

case "$1" in
  purge)
    # offer to remove chroot jail (if configured and still exists)
    if [ -e /usr/share/debconf/confmodule ]
    then
      . /usr/share/debconf/confmodule
      db_get cvsd/rootjail
      if [ "$RET" != "" ] && [ "$RET" != "/" ] && [ "$RET" != "none" ] && [ -d "$RET" ]
      then
        CHROOT="$RET"
        db_title "Removing cvsd"
        db_subst cvsd/remove_chroot rootjail "$CHROOT"
        db_input high cvsd/remove_chroot || true
        db_go
        db_get cvsd/remove_chroot
        if [ "$RET" = "true" ]
        then
          rm -rf "$CHROOT"
        fi
      fi
    fi
    # remove config
    rm -rf /etc/cvsd
    # remove user/group
    if [ -x "$(command -v deluser)" ]
    then
      deluser --quiet --system cvsd > /dev/null || true
    else
      echo "not removing cvsd system account because deluser command was not found" >&2
    fi
    if [ -x "$(command -v delgroup)" ]
    then
      delgroup --quiet --system cvsd > /dev/null || true
    else
      echo "not removing cvsd system group because delgroup command was not found" >&2
    fi
    ;;
esac

#DEBHELPER#

exit 0