diff options
author | H. P. <harald.p.@xmart.de> | 2018-07-05 21:12:23 +0200 |
---|---|---|
committer | H. P. <harald.p.@xmart.de> | 2018-07-05 21:12:23 +0200 |
commit | c0f075d29d897f2c1bdd689342d86e43dd652c81 (patch) | |
tree | d3b55dd2204e34b410bec6aaf4965f93f85e4be2 | |
parent | 6b9fea0f6966b4816fe5016493666d3e53fea08d (diff) | |
download | systemd-units-c0f075d29d897f2c1bdd689342d86e43dd652c81.tar.bz2 |
Code sanitising - removed dispensable logical operations
-rwxr-xr-x | usr/local/sbin/freshclamd | 11 |
1 files changed, 4 insertions, 7 deletions
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 } |