| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
case "$1" in |
| 6 |
purge) |
| 7 |
# offer to remove chroot jail (if configured and still exists) |
| 8 |
if [ -e /usr/share/debconf/confmodule ] |
| 9 |
then |
| 10 |
. /usr/share/debconf/confmodule |
| 11 |
db_get cvsd/rootjail |
| 12 |
if [ "$RET" != "" ] && [ "$RET" != "/" ] && [ "$RET" != "none" ] && [ -d "$RET" ] |
| 13 |
then |
| 14 |
CHROOT="$RET" |
| 15 |
db_title "Removing cvsd" |
| 16 |
db_subst cvsd/remove_chroot rootjail "$CHROOT" |
| 17 |
db_input high cvsd/remove_chroot || true |
| 18 |
db_go |
| 19 |
db_get cvsd/remove_chroot |
| 20 |
if [ "$RET" = "true" ] |
| 21 |
then |
| 22 |
rm -rf "$CHROOT" |
| 23 |
fi |
| 24 |
fi |
| 25 |
fi |
| 26 |
# remove config |
| 27 |
rm -rf /etc/cvsd |
| 28 |
# remove user/group |
| 29 |
if [ -x "$(command -v deluser)" ] |
| 30 |
then |
| 31 |
deluser --quiet --system cvsd > /dev/null || true |
| 32 |
else |
| 33 |
echo "not removing cvsd system account because deluser command was not found" >&2 |
| 34 |
fi |
| 35 |
if [ -x "$(command -v delgroup)" ] |
| 36 |
then |
| 37 |
delgroup --quiet --system cvsd > /dev/null || true |
| 38 |
else |
| 39 |
echo "not removing cvsd system group because delgroup command was not found" >&2 |
| 40 |
fi |
| 41 |
;; |
| 42 |
esac |
| 43 |
|
| 44 |
#DEBHELPER# |
| 45 |
|
| 46 |
exit 0 |