From dd4eefbb9dfa0063b9bfe68af1e9d7daeff6b0e7 Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Sat, 11 Apr 2020 22:02:32 +0800 Subject: [PATCH] More precise content --- README.md | 8 ++++++++ install-release.sh | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index adfcb43..3b05d54 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # alpinelinux-install-v2ray +## 依賴軟體 + +### 安裝 cURL + +``` +# apk add curl +``` + ## 下載 ``` diff --git a/install-release.sh b/install-release.sh index da3b869..06b4f58 100644 --- a/install-release.sh +++ b/install-release.sh @@ -49,6 +49,10 @@ done unzip -q "$ZIP_FILE" -d "$TMP_DIRECTORY" +if [ -n "$(pgrep v2ray)" ]; then + rc-service v2ray stop + V2RAY_RUNNING='1' +fi install -m 755 "${TMP_DIRECTORY}v2ray" "/usr/local/bin/v2ray" install -m 755 "${TMP_DIRECTORY}v2ctl" "/usr/local/bin/v2ctl" install -d /usr/local/lib/v2ray/ @@ -76,8 +80,6 @@ if [ ! -f '/etc/init.d/v2ray' ]; then OPENRC=yes fi -rm -r "$TMP_DIRECTORY" - echo 'installed: /usr/local/bin/v2ray' echo 'installed: /usr/local/bin/v2ctl' echo 'installed: /usr/local/lib/v2ray/geoip.dat' @@ -100,3 +102,13 @@ fi if [ -n "$OPENRC" ]; then echo 'installed: /etc/init.d/v2ray' fi +echo "You may need to execute a command to remove dependent software: apk del curl unzip" +if [ "$V2RAY_RUNNING" -eq '1' ]; then + rc-service v2ray start +else + echo 'Please execute the command: rcctl enable v2ray; rcctl start v2ray' +fi + +rm -r "$TMP_DIRECTORY" +echo "removed: $TMP_DIRECTORY" +echo "info: V2Ray is installed."