aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/flow-tools/files/pkg-deinstall.in
blob: cbc04bea3005c08b9c3fc5d9b253916b4a07a84d (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
#!/bin/sh
#
# $FreeBSD$
#

PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin

FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"

post-deinstall() {
    rmdir ${FLOW_CAPTURE_SPOOL} > /dev/null 2>&1
    if [ $? -ne 0 ]; then
        echo "WARNING: If you will NOT use this package anymore, please"
        echo " remove the following directory manually:"
        echo " ${FLOW_CAPTURE_SPOOL}"
        echo
        echo "Also flow-tools related user accounts and groups were not"
        echo "removed (${FLOW_CAPTURE_USER}:${FLOW_CAPTURE_GROUP})."
        echo "Do it manually, if needed."
        echo
    fi

#
# Remove pid directory
#
    rm -rf ${FLOW_CAPTURE_PIDDIR} > /dev/null 2>&1
}


case $2 in
    POST-DEINSTALL)
        post-deinstall
        ;;
esac