From ea2fc97a312ed21122bc0e69663e44415828fec4 Mon Sep 17 00:00:00 2001 From: xiagw Date: Thu, 17 Sep 2020 17:49:20 +0700 Subject: [PATCH] fix5: fix function start_v2ray --- install-release.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/install-release.sh b/install-release.sh index 1f0866b..fb4f5df 100644 --- a/install-release.sh +++ b/install-release.sh @@ -388,17 +388,13 @@ install_startup_service_file() { start_v2ray() { if [[ -f '/etc/systemd/system/v2ray.service' ]]; then - if [[ -z "$V2RAY_CUSTOMIZE" ]]; then - systemctl start v2ray + if systemctl start "${V2RAY_CUSTOMIZE:-v2ray}"; then + echo 'info: Start the V2Ray service.' else - systemctl start "$V2RAY_CUSTOMIZE" + echo 'error: Failed to start V2Ray service.' + exit 1 fi fi - if [[ "$?" -ne 0 ]]; then - echo 'error: Failed to start V2Ray service.' - exit 1 - fi - echo 'info: Start the V2Ray service.' } stop_v2ray() {