summaryrefslogtreecommitdiff
path: root/security/sancp/pkg-deinstall
blob: 143ec1bc244c41848981aeef7c504abf47d5b387 (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
#!/bin/sh

PATH=/bin:/usr/sbin
USER=sancp
GROUP=${USER}
LOG_DIR=/var/log/sancp

# Remove the log directory
if [ -d ${LOG_DIR} ]; 
then 
	rmdir ${LOG_DIR} >/dev/null 2>&1; 
fi

if pw user show "${USER}" >/dev/null 2>&1; then
        if ! pw userdel ${USER} ;          
        then
                echo "Unable to remove user: ${USER}, remove it manually"
        fi
fi


if pw group show "${GROUP}" >/dev/null 2>&1; then
	if ! pw groupdel ${GROUP} ; 
	then
		echo "Unable to remove group: ${GROUP}, remove it manually"
	fi
fi