From 823d8b644d2c85b82420ae9c879be0c067289f58 Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Mon, 27 Jul 2020 01:04:53 +0800 Subject: [PATCH] fix: Changed from pgrep to pidof 1. Resolve incorrect matching issues. issue #29 --- install-release.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-release.sh b/install-release.sh index 0e9785b..3de81e0 100644 --- a/install-release.sh +++ b/install-release.sh @@ -424,8 +424,8 @@ check_update() { } remove_v2ray() { - if [[ -f '/etc/systemd/system/v2ray.service' ]]; then - if [[ -n "$(pgrep v2ray)" ]]; then + if [[ -n "$(systemctl list-unit-files | grep 'v2ray')" ]]; then + if [[ -n "$(pidof v2ray)" ]]; then stop_v2ray fi NAME="$1" @@ -514,7 +514,7 @@ main() { # Determine if V2Ray is running if [[ -n "$(systemctl list-unit-files | grep 'v2ray')" ]]; then - if [[ -n "$(pgrep v2ray)" ]]; then + if [[ -n "$(pidof v2ray)" ]]; then stop_v2ray V2RAY_RUNNING='1' fi