From cace23b822a2270ddf2f5c9614c85e86b3cf7012 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 13:23:39 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=B0=86=E6=89=80=E6=9C=89exit=E6=94=B9?= =?UTF-8?q?=E4=B8=BAreturn=EF=BC=8C=E5=B9=B6=E5=9C=A8=E9=80=82=E5=BD=93?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E6=96=B9=E5=A2=9E=E5=8A=A0return?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目的是增加脚本可读性 --- release/install-release.sh | 46 ++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/release/install-release.sh b/release/install-release.sh index d67ed56b..b97bd5db 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -97,7 +97,7 @@ downloadV2Ray(){ curl ${PROXY} -L -H "Cache-Control: no-cache" -o ${ZIPFILE} ${DOWNLOAD_LINK} if [ $? != 0 ];then colorEcho ${RED} "Failed to download! Please check your network or try again." - exit 1 + return 3 fi return 0 } @@ -111,7 +111,7 @@ installSoftware(){ getPMT if [[ $? -eq 1 ]]; then colorEcho $YELLOW "The system package manager tool isn't APT or YUM, please install ${COMPONENT} manually." - exit + return 2 fi colorEcho $GREEN "Installing $COMPONENT" if [[ $SOFTWARE_UPDATED -eq 0 ]]; then @@ -124,7 +124,7 @@ installSoftware(){ $CMD_INSTALL $COMPONENT if [[ $? -ne 0 ]]; then colorEcho ${RED} "Install ${COMPONENT} fail, please install it manually." - exit + return 2 fi return 0 } @@ -150,7 +150,7 @@ extract(){ unzip $1 -d "/tmp/v2ray/" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Extracting V2Ray failed!" - exit + return 2 fi return 0 } @@ -264,7 +264,7 @@ installInitScript(){ fi return elif [[ -n "${SERVICE_CMD}" ]] && [[ ! -f "/etc/init.d/v2ray" ]]; then - installSoftware "daemon" + installSoftware "daemon" || return $? cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv/v2ray" "/etc/init.d/v2ray" chmod +x "/etc/init.d/v2ray" update-rc.d v2ray defaults @@ -281,7 +281,6 @@ Help(){ echo " -l, --local Install from a local file" echo " --remove Remove installed V2Ray" echo " -c, --check Check for update" - exit } remove(){ @@ -295,11 +294,11 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - exit + return 0 else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - exit + return fi elif [[ -n "${SYSTEMCTL_CMD}" ]] && [[ -f "/lib/systemd/system/v2ray.service" ]];then if pgrep "v2ray" > /dev/null ; then @@ -309,11 +308,11 @@ remove(){ rm -rf "/usr/bin/v2ray" "/lib/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - exit + return 0 else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - exit + return fi elif [[ -n "${SERVICE_CMD}" ]] && [[ -f "/etc/init.d/v2ray" ]]; then if pgrep "v2ray" > /dev/null ; then @@ -322,15 +321,15 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/init.d/v2ray" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - exit + return 0 else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - exit + return fi else colorEcho ${GREEN} "V2Ray not found." - exit + return 0 fi } @@ -348,31 +347,31 @@ checkUpdate(){ main(){ #helping information - [[ "$HELP" == "1" ]] && Help [[ "$CHECK" == "1" ]] && checkUpdate - [[ "$REMOVE" == "1" ]] && remove + [[ "$HELP" == "1" ]] && Help && return + [[ "$REMOVE" == "1" ]] && remove && return sysArch # extract local file if [[ $LOCAL_INSTALL -eq 1 ]]; then echo "Install V2Ray via local file" - installSoftware unzip + installSoftware unzip || return $? rm -rf /tmp/v2ray - extract $LOCAL + extract $LOCAL || return $? FILEVDIS=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f4` SYSTEM=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f3` if [[ ${SYSTEM} != "linux" ]]; then colorEcho $RED "The local V2Ray can not be installed in linux." - exit + return 1 elif [[ ${FILEVDIS} != ${VDIS} ]]; then colorEcho $RED "The local V2Ray can not be installed in ${ARCH} system." - exit + return 1 else NEW_VER=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f2` fi else # download via network and extract - installSoftware "curl" + installSoftware "curl" || return $? getVersion if [[ $? == 0 ]] && [[ "$FORCE" != "1" ]]; then colorEcho ${GREEN} "Latest version ${NEW_VER} is already installed." @@ -388,12 +387,11 @@ main(){ V2RAY_RUNNING=1 stopV2ray fi - installV2Ray - installInitScript + installV2Ray || return $? + installInitScript || return $? if [[ ${V2RAY_RUNNING} -eq 1 ]];then colorEcho ${BLUE} "Restarting V2Ray service." - startV2ray - + startV2ray || return $? fi colorEcho ${GREEN} "V2Ray ${NEW_VER} is installed." rm -rf /tmp/v2ray From d4124dfe9bc541755b8149ed98072c0f05956e41 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 13:52:37 +0800 Subject: [PATCH 02/12] =?UTF-8?q?Revert=20"=E5=B0=86=E6=89=80=E6=9C=89exit?= =?UTF-8?q?=E6=94=B9=E4=B8=BAreturn=EF=BC=8C=E5=B9=B6=E5=9C=A8=E9=80=82?= =?UTF-8?q?=E5=BD=93=E7=9A=84=E5=9C=B0=E6=96=B9=E5=A2=9E=E5=8A=A0return"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit cace23b822a2270ddf2f5c9614c85e86b3cf7012. --- release/install-release.sh | 46 ++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/release/install-release.sh b/release/install-release.sh index b97bd5db..d67ed56b 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -97,7 +97,7 @@ downloadV2Ray(){ curl ${PROXY} -L -H "Cache-Control: no-cache" -o ${ZIPFILE} ${DOWNLOAD_LINK} if [ $? != 0 ];then colorEcho ${RED} "Failed to download! Please check your network or try again." - return 3 + exit 1 fi return 0 } @@ -111,7 +111,7 @@ installSoftware(){ getPMT if [[ $? -eq 1 ]]; then colorEcho $YELLOW "The system package manager tool isn't APT or YUM, please install ${COMPONENT} manually." - return 2 + exit fi colorEcho $GREEN "Installing $COMPONENT" if [[ $SOFTWARE_UPDATED -eq 0 ]]; then @@ -124,7 +124,7 @@ installSoftware(){ $CMD_INSTALL $COMPONENT if [[ $? -ne 0 ]]; then colorEcho ${RED} "Install ${COMPONENT} fail, please install it manually." - return 2 + exit fi return 0 } @@ -150,7 +150,7 @@ extract(){ unzip $1 -d "/tmp/v2ray/" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Extracting V2Ray failed!" - return 2 + exit fi return 0 } @@ -264,7 +264,7 @@ installInitScript(){ fi return elif [[ -n "${SERVICE_CMD}" ]] && [[ ! -f "/etc/init.d/v2ray" ]]; then - installSoftware "daemon" || return $? + installSoftware "daemon" cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv/v2ray" "/etc/init.d/v2ray" chmod +x "/etc/init.d/v2ray" update-rc.d v2ray defaults @@ -281,6 +281,7 @@ Help(){ echo " -l, --local Install from a local file" echo " --remove Remove installed V2Ray" echo " -c, --check Check for update" + exit } remove(){ @@ -294,11 +295,11 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - return 0 + exit else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - return + exit fi elif [[ -n "${SYSTEMCTL_CMD}" ]] && [[ -f "/lib/systemd/system/v2ray.service" ]];then if pgrep "v2ray" > /dev/null ; then @@ -308,11 +309,11 @@ remove(){ rm -rf "/usr/bin/v2ray" "/lib/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - return 0 + exit else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - return + exit fi elif [[ -n "${SERVICE_CMD}" ]] && [[ -f "/etc/init.d/v2ray" ]]; then if pgrep "v2ray" > /dev/null ; then @@ -321,15 +322,15 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/init.d/v2ray" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - return 0 + exit else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - return + exit fi else colorEcho ${GREEN} "V2Ray not found." - return 0 + exit fi } @@ -347,31 +348,31 @@ checkUpdate(){ main(){ #helping information + [[ "$HELP" == "1" ]] && Help [[ "$CHECK" == "1" ]] && checkUpdate - [[ "$HELP" == "1" ]] && Help && return - [[ "$REMOVE" == "1" ]] && remove && return + [[ "$REMOVE" == "1" ]] && remove sysArch # extract local file if [[ $LOCAL_INSTALL -eq 1 ]]; then echo "Install V2Ray via local file" - installSoftware unzip || return $? + installSoftware unzip rm -rf /tmp/v2ray - extract $LOCAL || return $? + extract $LOCAL FILEVDIS=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f4` SYSTEM=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f3` if [[ ${SYSTEM} != "linux" ]]; then colorEcho $RED "The local V2Ray can not be installed in linux." - return 1 + exit elif [[ ${FILEVDIS} != ${VDIS} ]]; then colorEcho $RED "The local V2Ray can not be installed in ${ARCH} system." - return 1 + exit else NEW_VER=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f2` fi else # download via network and extract - installSoftware "curl" || return $? + installSoftware "curl" getVersion if [[ $? == 0 ]] && [[ "$FORCE" != "1" ]]; then colorEcho ${GREEN} "Latest version ${NEW_VER} is already installed." @@ -387,11 +388,12 @@ main(){ V2RAY_RUNNING=1 stopV2ray fi - installV2Ray || return $? - installInitScript || return $? + installV2Ray + installInitScript if [[ ${V2RAY_RUNNING} -eq 1 ]];then colorEcho ${BLUE} "Restarting V2Ray service." - startV2ray || return $? + startV2ray + fi colorEcho ${GREEN} "V2Ray ${NEW_VER} is installed." rm -rf /tmp/v2ray From 5784d3ce9c0237df0842372cc960c81895767706 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 14:01:19 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=B0=86=E6=89=80=E6=9C=89exit=E6=94=B9?= =?UTF-8?q?=E4=B8=BAreturn=EF=BC=8C=E5=B9=B6=E5=9C=A8=E9=80=82=E5=BD=93?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E6=96=B9=E5=A2=9E=E5=8A=A0return?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目的是增加脚本可读性 --- release/install-release.sh | 45 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/release/install-release.sh b/release/install-release.sh index d67ed56b..b2cfc4e7 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -97,7 +97,7 @@ downloadV2Ray(){ curl ${PROXY} -L -H "Cache-Control: no-cache" -o ${ZIPFILE} ${DOWNLOAD_LINK} if [ $? != 0 ];then colorEcho ${RED} "Failed to download! Please check your network or try again." - exit 1 + return 3 fi return 0 } @@ -111,7 +111,7 @@ installSoftware(){ getPMT if [[ $? -eq 1 ]]; then colorEcho $YELLOW "The system package manager tool isn't APT or YUM, please install ${COMPONENT} manually." - exit + return 2 fi colorEcho $GREEN "Installing $COMPONENT" if [[ $SOFTWARE_UPDATED -eq 0 ]]; then @@ -124,7 +124,7 @@ installSoftware(){ $CMD_INSTALL $COMPONENT if [[ $? -ne 0 ]]; then colorEcho ${RED} "Install ${COMPONENT} fail, please install it manually." - exit + return 2 fi return 0 } @@ -150,7 +150,7 @@ extract(){ unzip $1 -d "/tmp/v2ray/" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Extracting V2Ray failed!" - exit + return 2 fi return 0 } @@ -264,7 +264,7 @@ installInitScript(){ fi return elif [[ -n "${SERVICE_CMD}" ]] && [[ ! -f "/etc/init.d/v2ray" ]]; then - installSoftware "daemon" + installSoftware "daemon" || return $? cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv/v2ray" "/etc/init.d/v2ray" chmod +x "/etc/init.d/v2ray" update-rc.d v2ray defaults @@ -295,11 +295,11 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - exit + return else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - exit + return 0 fi elif [[ -n "${SYSTEMCTL_CMD}" ]] && [[ -f "/lib/systemd/system/v2ray.service" ]];then if pgrep "v2ray" > /dev/null ; then @@ -309,11 +309,11 @@ remove(){ rm -rf "/usr/bin/v2ray" "/lib/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - exit + return else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - exit + return 0 fi elif [[ -n "${SERVICE_CMD}" ]] && [[ -f "/etc/init.d/v2ray" ]]; then if pgrep "v2ray" > /dev/null ; then @@ -322,15 +322,15 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/init.d/v2ray" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - exit + return else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." - exit + return 0 fi else colorEcho ${GREEN} "V2Ray not found." - exit + return 0 fi } @@ -348,31 +348,31 @@ checkUpdate(){ main(){ #helping information - [[ "$HELP" == "1" ]] && Help [[ "$CHECK" == "1" ]] && checkUpdate - [[ "$REMOVE" == "1" ]] && remove + [[ "$HELP" == "1" ]] && Help && return + [[ "$REMOVE" == "1" ]] && remove && return sysArch # extract local file if [[ $LOCAL_INSTALL -eq 1 ]]; then echo "Install V2Ray via local file" - installSoftware unzip + installSoftware unzip || return $? rm -rf /tmp/v2ray - extract $LOCAL + extract $LOCAL || return $? FILEVDIS=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f4` SYSTEM=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f3` if [[ ${SYSTEM} != "linux" ]]; then colorEcho $RED "The local V2Ray can not be installed in linux." - exit + return 1 elif [[ ${FILEVDIS} != ${VDIS} ]]; then colorEcho $RED "The local V2Ray can not be installed in ${ARCH} system." - exit + return 1 else NEW_VER=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f2` fi else # download via network and extract - installSoftware "curl" + installSoftware "curl" || return $? getVersion if [[ $? == 0 ]] && [[ "$FORCE" != "1" ]]; then colorEcho ${GREEN} "Latest version ${NEW_VER} is already installed." @@ -388,12 +388,11 @@ main(){ V2RAY_RUNNING=1 stopV2ray fi - installV2Ray - installInitScript + installV2Ray || return $? + installInitScript || return $? if [[ ${V2RAY_RUNNING} -eq 1 ]];then colorEcho ${BLUE} "Restarting V2Ray service." - startV2ray - + startV2ray || return $? fi colorEcho ${GREEN} "V2Ray ${NEW_VER} is installed." rm -rf /tmp/v2ray From 78ac8470b556b107f333972ef74596f157757509 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 14:06:14 +0800 Subject: [PATCH 04/12] Update install-release.sh --- release/install-release.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/release/install-release.sh b/release/install-release.sh index b2cfc4e7..42e85f4c 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -281,7 +281,6 @@ Help(){ echo " -l, --local Install from a local file" echo " --remove Remove installed V2Ray" echo " -c, --check Check for update" - exit } remove(){ From 3f1bb73e2ac481e278fe6154d9ab4b11b2097606 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 14:15:21 +0800 Subject: [PATCH 05/12] Update install-release.sh --- release/install-release.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/release/install-release.sh b/release/install-release.sh index 42e85f4c..351ec4bc 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -99,7 +99,6 @@ downloadV2Ray(){ colorEcho ${RED} "Failed to download! Please check your network or try again." return 3 fi - return 0 } installSoftware(){ From 58794ddcb435cf26404f8a04288595a6fb1bdcf5 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 14:18:40 +0800 Subject: [PATCH 06/12] Update install-release.sh --- release/install-release.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/release/install-release.sh b/release/install-release.sh index 351ec4bc..c569a57e 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -125,7 +125,6 @@ installSoftware(){ colorEcho ${RED} "Install ${COMPONENT} fail, please install it manually." return 2 fi - return 0 } # return 1: not apt or yum @@ -139,7 +138,6 @@ getPMT(){ else return 1 fi - return 0 } @@ -151,7 +149,6 @@ extract(){ colorEcho ${RED} "Extracting V2Ray failed!" return 2 fi - return 0 } @@ -246,7 +243,6 @@ installV2Ray(){ colorEcho ${GREEN} "UUID:${UUID}" mkdir -p /var/log/v2ray fi - return 0 } From de163ba487d65195f9751c33c360697b5e99bf59 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 15:46:52 +0800 Subject: [PATCH 07/12] Update install-release.sh --- release/install-release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/release/install-release.sh b/release/install-release.sh index c569a57e..872d4f00 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -373,9 +373,9 @@ main(){ exit else colorEcho ${BLUE} "Installing V2Ray ${NEW_VER} on ${ARCH}" - downloadV2Ray - installSoftware unzip - extract ${ZIPFILE} + downloadV2Ray || return $? + installSoftware unzip || return $? + extract ${ZIPFILE} || return $? fi fi if pgrep "v2ray" > /dev/null ; then @@ -386,7 +386,7 @@ main(){ installInitScript || return $? if [[ ${V2RAY_RUNNING} -eq 1 ]];then colorEcho ${BLUE} "Restarting V2Ray service." - startV2ray || return $? + startV2ray fi colorEcho ${GREEN} "V2Ray ${NEW_VER} is installed." rm -rf /tmp/v2ray From 266042a250618789600bb67bf4d15c223b689725 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 15:48:32 +0800 Subject: [PATCH 08/12] Update install-release.sh --- release/install-release.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/install-release.sh b/release/install-release.sh index 872d4f00..6c3841c3 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -289,7 +289,7 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - return + return 0 else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." @@ -303,7 +303,7 @@ remove(){ rm -rf "/usr/bin/v2ray" "/lib/systemd/system/v2ray.service" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - return + return 0 else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." @@ -316,7 +316,7 @@ remove(){ rm -rf "/usr/bin/v2ray" "/etc/init.d/v2ray" if [[ $? -ne 0 ]]; then colorEcho ${RED} "Failed to remove V2Ray." - return + return 0 else colorEcho ${GREEN} "Removed V2Ray successfully." colorEcho ${GREEN} "If necessary, please remove configuration file and log file manually." From ee1a49bf250fd3bcad16f9bf29b80dd4a3e9d514 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 15:50:33 +0800 Subject: [PATCH 09/12] Update install-release.sh --- release/install-release.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/release/install-release.sh b/release/install-release.sh index 6c3841c3..f1f08ae9 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -276,6 +276,7 @@ Help(){ echo " -l, --local Install from a local file" echo " --remove Remove installed V2Ray" echo " -c, --check Check for update" + return 0 } remove(){ From e6ac13bf8cfb009de95a7e8192bf7021faa06428 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 15:57:04 +0800 Subject: [PATCH 10/12] Update install-release.sh --- release/install-release.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release/install-release.sh b/release/install-release.sh index f1f08ae9..1327f031 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -99,6 +99,7 @@ downloadV2Ray(){ colorEcho ${RED} "Failed to download! Please check your network or try again." return 3 fi + return 0 } installSoftware(){ @@ -125,6 +126,7 @@ installSoftware(){ colorEcho ${RED} "Install ${COMPONENT} fail, please install it manually." return 2 fi + return 0 } # return 1: not apt or yum @@ -138,6 +140,7 @@ getPMT(){ else return 1 fi + return 0 } @@ -149,6 +152,7 @@ extract(){ colorEcho ${RED} "Extracting V2Ray failed!" return 2 fi + return 0 } @@ -243,6 +247,7 @@ installV2Ray(){ colorEcho ${GREEN} "UUID:${UUID}" mkdir -p /var/log/v2ray fi + return 0 } From 765c44c2ac577003bc8ac61c4571c388bb856f83 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 16:03:40 +0800 Subject: [PATCH 11/12] Update install-release.sh --- release/install-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/install-release.sh b/release/install-release.sh index 1327f031..42fc2fa8 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -388,7 +388,7 @@ main(){ V2RAY_RUNNING=1 stopV2ray fi - installV2Ray || return $? + installV2Ray installInitScript || return $? if [[ ${V2RAY_RUNNING} -eq 1 ]];then colorEcho ${BLUE} "Restarting V2Ray service." From b0ded2f5a6b01ff513a5fdf98e6a0c5620bdd739 Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Thu, 12 Apr 2018 21:38:18 +0800 Subject: [PATCH 12/12] Update install-release.sh --- release/install-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/install-release.sh b/release/install-release.sh index 42fc2fa8..0844369c 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -348,8 +348,8 @@ checkUpdate(){ main(){ #helping information - [[ "$CHECK" == "1" ]] && checkUpdate [[ "$HELP" == "1" ]] && Help && return + [[ "$CHECK" == "1" ]] && checkUpdate [[ "$REMOVE" == "1" ]] && remove && return sysArch