fix function get_versionchange to if -n,reduce indent
parent
f607e17837
commit
cbf08bdb26
|
@ -182,11 +182,14 @@ get_version() {
|
||||||
# 0: Install or update V2Ray.
|
# 0: Install or update V2Ray.
|
||||||
# 1: Installed or no new version of V2Ray.
|
# 1: Installed or no new version of V2Ray.
|
||||||
# 2: Install the specified version of V2Ray.
|
# 2: Install the specified version of V2Ray.
|
||||||
if [[ -z "$VERSION" ]]; then
|
if [[ -n "$VERSION" ]]; then
|
||||||
|
RELEASE_VERSION="$(version_number "$VERSION")"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
# Determine the version number for V2Ray installed from a local file
|
# Determine the version number for V2Ray installed from a local file
|
||||||
if [[ -f '/usr/local/bin/v2ray' ]]; then
|
if [[ -f '/usr/local/bin/v2ray' ]]; then
|
||||||
VERSION="$(/usr/local/bin/v2ray -version)"
|
VERSION="$(/usr/local/bin/v2ray -version)"
|
||||||
CURRENT_VERSION="$(version_number $(echo "$VERSION" | head -n 1 | awk -F ' ' '{print $2}'))"
|
CURRENT_VERSION="$(version_number "$(echo "$VERSION" | awk 'NR==1 {print $2}')")"
|
||||||
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
||||||
RELEASE_VERSION="$CURRENT_VERSION"
|
RELEASE_VERSION="$CURRENT_VERSION"
|
||||||
return
|
return
|
||||||
|
@ -234,10 +237,6 @@ get_version() {
|
||||||
elif [[ "$RELEASE_VERSION" == "$CURRENT_VERSION" ]]; then
|
elif [[ "$RELEASE_VERSION" == "$CURRENT_VERSION" ]]; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
RELEASE_VERSION="$(version_number "$VERSION")"
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
download_v2ray() {
|
download_v2ray() {
|
||||||
|
|
Loading…
Reference in New Issue