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 #29pull/30/head
parent
b09dd49446
commit
d72aa48586
|
@ -513,10 +513,12 @@ main() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine if V2Ray is running
|
# Determine if V2Ray is running
|
||||||
|
if [[ -n "$(systemctl list-unit-files | grep 'v2ray')" ]]; then
|
||||||
if [[ -n "$(pgrep v2ray)" ]]; then
|
if [[ -n "$(pgrep v2ray)" ]]; then
|
||||||
stop_v2ray
|
stop_v2ray
|
||||||
V2RAY_RUNNING='1'
|
V2RAY_RUNNING='1'
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
install_v2ray
|
install_v2ray
|
||||||
install_startup_service_file
|
install_startup_service_file
|
||||||
echo 'installed: /usr/local/bin/v2ray'
|
echo 'installed: /usr/local/bin/v2ray'
|
||||||
|
|
Loading…
Reference in New Issue