From d72aa48586d730101028fb65dff10c8f48f39733 Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Sun, 26 Jul 2020 23:02:15 +0800 Subject: [PATCH] fix: Incorrect execution of stop_v2ray function 1. In the first installation, if there happens to be a V2Ray service that is not managed by systemd, or if there is a judgment error, the stop_v2ray function will be executed incorrectly, which will cause the installation to fail. issue #29 --- install-release.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install-release.sh b/install-release.sh index a166f9d..0e9785b 100644 --- a/install-release.sh +++ b/install-release.sh @@ -513,9 +513,11 @@ main() { fi # Determine if V2Ray is running - if [[ -n "$(pgrep v2ray)" ]]; then - stop_v2ray - V2RAY_RUNNING='1' + if [[ -n "$(systemctl list-unit-files | grep 'v2ray')" ]]; then + if [[ -n "$(pgrep v2ray)" ]]; then + stop_v2ray + V2RAY_RUNNING='1' + fi fi install_v2ray install_startup_service_file