aboutsummaryrefslogtreecommitdiff
path: root/irc/ircproxy/files/pkg-deinstall.in
blob: 1ea52d8dba1fa3acd6ad1c495e0ec9391e15ec05 (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
#!/bin/sh

case $2 in
    POST-DEINSTALL)
    cat <<EOMSG

Note:
The ircproxy related user accounts and groups were not removed.

To remove the %%IRC_USR%% user and the %%IRC_GRP%% group which were
created by a default installation of this package, run:

    # pw groupdel %%IRC_GRP%%
    # pw userdel %%IRC_USR%%

EOMSG

PIDFILE="/var/run/ircproxyd.pid"

  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
    echo
    ;;
esac