diff --git a/release/install-release.sh b/release/install-release.sh index 75ac8f7f..396fc97b 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -46,8 +46,13 @@ function update_software() { } function install_component() { - update_software local COMPONENT=$1 + COMPONENT_CMD=$(command -v $COMPONENT) + if [ -n "${COMPONENT_CMD}"]; then + return + fi + + update_software if [ -n "${YUM_CMD}" ]; then echo "Installing ${COMPONENT} via yum." ${YUM_CMD} -y -q install $COMPONENT @@ -64,6 +69,13 @@ fi VER="$(curl -s https://api.github.com/repos/v2ray/v2ray-core/releases/latest | grep 'tag_name' | cut -d\" -f4)" +CUR_VER="$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)" + +if [[ "$VER" == "$CUR_VER"]]; then + echo "Lastest version $VER is already installed. Exiting..." + return +fi + ARCH=$(uname -m) VDIS="64"