summaryrefslogtreecommitdiff
path: root/www/horde4-base/files/pkg-deinstall.in
blob: c9c3090677899dcc2b52f7a9dd2e6cfe1214fcb9 (plain) (blame)
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
#!/bin/sh
#
# $FreeBSD$
#

PATH=/usr/sbin:/usr/bin:/bin ; export PATH

handle_config() {
    if [ -z "${PACKAGE_BUILDING}" ]; then
      for cf in %%HORDIR%%/config/*.dist; do
        diff -bBqw $cf ${cf%.dist} >/dev/null 2>&1
        case $? in
          0)  # original config file, delete
              rm -f ${cf%.dist}
              ;;
          1)  # config file has been updated, leave it
              ;;
          *)  # not found?
              ;;
        esac
      done
    fi
}

case $2 in
    DEINSTALL)
      handle_config
      ;;
    POST-DEINSTALL)
      if [ x%%HORDEADMUSR%% != x ]; then
            cat <<EOMSG
A horde port has been deleted. If you are not upgrading
and don't intend to use Horde any more then you may wish
to delete the %%HORDEADMUSR%% account, which can be done
with the following command:

    # pw userdel %%HORDEADMUSR%%
EOMSG
	fi
	;;
esac