git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/usr/local/bin/freshclam-die
blob: 0cd3e4ba5aeb7aac798f48993573974888563acd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

FCPIDF="/run/freshclam/freshclam.pid"

[ ! -e "$FCPIDF" ]&&exit 1
FCPID="$(cat "$FCPIDF")"
[ -z "$FCPID" ]&&exit 2
ps -p "$FCPID" >/dev/null 2>&1
[ "$?" -ne 0 ]&&exit 3
kill "$FCPID" >/dev/null 2>&1
sleep 1
ps -p "$FCPID" >/dev/null 2>&1||exit 0
sleep 10
kill -9 "$FCPID" >/dev/null 2>&1
sleep 2
ps -p "$FCPID" >/dev/null 2>&1&&exit 4||exit 0