blob: 5430bebd78fb00c30c4d4279867e8b3f52e3f7ee (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#!/bin/sh
#
# Night Light IRC Proxy
# Deinstallation script for FreeBSD ports
# Written by Jonas Kvinge
#
# Last modified: Jonas Kvinge (03.09.2006)
#
BINFILE=ircproxyd
PIDFILE="/var/run/ircproxyd.pid"
EUSER="ircproxy"
EGROUP="ircproxy"
if [ "$2" = "DEINSTALL" ]; then
#grep -q "^[^#]*${PKG_PREFIX}/sbin/ircproxy\.sh" /etc/crontab >/dev/null 2>&1
#if [ $? -eq 0 ]; then
# sed -i -e "s:^[^#]*${PKG_PREFIX}/sbin/ircproxy\.sh::" /etc/crontab
# sed -i -e '/^$/d' /etc/crontab
# rm -f /etc/crontab-e
#fi
if [ -f $PIDFILE ] && [ -r $PIDFILE ] ; then
PID=`cat "$PIDFILE"`
ps -p "$PID" >/dev/null 2>&1
if [ $? -eq 0 ]; then
for count in 1 2 3 4 5 6 7 8 9 10; do
if [ $count -ge 5 ]; then
kill -KILL "$PID" || break
break
fi
kill -TERM "$PID" || break
sleep 2
ps -p "$PID" >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
break;
fi
done
fi
fi
fi
if [ "$2" = "POST-DEINSTALL" ]; then
pw group show ${EGROUP} >/dev/null 2>&1
if [ $? -eq 0 ] ; then
pw groupdel -n "$EGROUP"
fi
pw user show ${EUSER} >/dev/null 2>&1
if [ $? -eq 0 ] ; then
pw userdel -n "$EUSER"
fi
fi
exit 0
|