From c0f075d29d897f2c1bdd689342d86e43dd652c81 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Thu, 5 Jul 2018 21:12:23 +0200 Subject: Code sanitising - removed dispensable logical operations --- usr/local/sbin/freshclamd | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'usr/local/sbin') diff --git a/usr/local/sbin/freshclamd b/usr/local/sbin/freshclamd index a3bc2b3..1dd474d 100755 --- a/usr/local/sbin/freshclamd +++ b/usr/local/sbin/freshclamd @@ -7,16 +7,11 @@ fresh_start() { fresh_stop() { if [ ! -e "$FCPIDF" ];then - pidof "$(which freshclam)" >/dev/null - [ "$?" -eq 0 ]&&exit 1 + pidof "$(which freshclam)" >/dev/null&&exit 1 else FCPID="$(cat "$FCPIDF")" [ -z "$FCPID" ]&&exit 2 - ps -p "$FCPID" >/dev/null 2>&1 - if [ "$?" -ne 0 ];then - rm -f "$FCPIDF" >/dev/null 2>&1 - [ "$?" -ne 0 ]&&exit 3 - else + if ps -p "$FCPID" >/dev/null 2>&1; then kill "$FCPID" >/dev/null 2>&1 sleep 1 ps -p "$FCPID" >/dev/null 2>&1||exit 0 @@ -24,6 +19,8 @@ fresh_stop() { kill -9 "$FCPID" >/dev/null 2>&1 sleep 2 ps -p "$FCPID" >/dev/null 2>&1&&exit 4||exit 0 + else + rm -f "$FCPIDF" >/dev/null 2>&1||exit 3 fi fi } -- cgit v1.2.3