From b1332ed3c4ea2f6667ce3149fdcc2be047ea119a Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Thu, 5 Jul 2018 20:11:59 +0200 Subject: Initial commit --- usr/local/bin/freshclam-die | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 usr/local/bin/freshclam-die (limited to 'usr/local/bin/freshclam-die') diff --git a/usr/local/bin/freshclam-die b/usr/local/bin/freshclam-die new file mode 100755 index 0000000..0cd3e4b --- /dev/null +++ b/usr/local/bin/freshclam-die @@ -0,0 +1,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 -- cgit v1.2.3