git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-07-05 20:11:59 +0200
committerHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-07-05 20:11:59 +0200
commitb1332ed3c4ea2f6667ce3149fdcc2be047ea119a (patch)
tree2814be2e7dc211ada46731e6fb0363005944551a /usr
downloadsystemd-units-b1332ed3c4ea2f6667ce3149fdcc2be047ea119a.tar.bz2
Initial commit
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/bin/freshclam-die16
-rwxr-xr-xusr/local/bin/freshclam-start3
2 files changed, 19 insertions, 0 deletions
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
diff --git a/usr/local/bin/freshclam-start b/usr/local/bin/freshclam-start
new file mode 100755
index 0000000..e8096d2
--- /dev/null
+++ b/usr/local/bin/freshclam-start
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/bin/freshclam --daemon --checks=4 --pid="/run/freshclam/freshclam.pid"