Merge pull request #165 from IceCodeNew/develop
commit
7fef216fd6
|
@ -14,7 +14,7 @@ on:
|
||||||
- develop
|
- develop
|
||||||
jobs:
|
jobs:
|
||||||
sh-checker:
|
sh-checker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-16.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Run the sh-checker
|
- name: Run the sh-checker
|
||||||
|
@ -26,11 +26,11 @@ jobs:
|
||||||
sh_checker_comment: true
|
sh_checker_comment: true
|
||||||
sh_checker_exclude: "LICENSE README.md README.zh-Hans-CN.md"
|
sh_checker_exclude: "LICENSE README.md README.zh-Hans-CN.md"
|
||||||
filed-test:
|
filed-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-16.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Filed-test on Ubuntu
|
- name: Filed-test on Ubuntu 16.04
|
||||||
run: |
|
run: |
|
||||||
sudo bash install-release.sh
|
sudo bash install-release.sh
|
||||||
sudo bash install-release.sh --check
|
sudo bash install-release.sh --check
|
||||||
|
|
|
@ -116,27 +116,22 @@ identify_the_operating_system_and_architecture() {
|
||||||
PACKAGE_MANAGEMENT_INSTALL='apt -y --no-install-recommends install'
|
PACKAGE_MANAGEMENT_INSTALL='apt -y --no-install-recommends install'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='apt purge'
|
PACKAGE_MANAGEMENT_REMOVE='apt purge'
|
||||||
package_provide_tput='ncurses-bin'
|
package_provide_tput='ncurses-bin'
|
||||||
package_provide_bsdtar='libarchive-tools'
|
|
||||||
elif [[ "$(type -P dnf)" ]]; then
|
elif [[ "$(type -P dnf)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_INSTALL='dnf -y install'
|
PACKAGE_MANAGEMENT_INSTALL='dnf -y install'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='dnf remove'
|
PACKAGE_MANAGEMENT_REMOVE='dnf remove'
|
||||||
package_provide_tput='ncurses'
|
package_provide_tput='ncurses'
|
||||||
package_provide_bsdtar='bsdtar'
|
|
||||||
elif [[ "$(type -P yum)" ]]; then
|
elif [[ "$(type -P yum)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_INSTALL='yum -y install'
|
PACKAGE_MANAGEMENT_INSTALL='yum -y install'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='yum remove'
|
PACKAGE_MANAGEMENT_REMOVE='yum remove'
|
||||||
package_provide_tput='ncurses'
|
package_provide_tput='ncurses'
|
||||||
package_provide_bsdtar='bsdtar'
|
|
||||||
elif [[ "$(type -P zypper)" ]]; then
|
elif [[ "$(type -P zypper)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_INSTALL='zypper install -y --no-recommends'
|
PACKAGE_MANAGEMENT_INSTALL='zypper install -y --no-recommends'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='zypper remove'
|
PACKAGE_MANAGEMENT_REMOVE='zypper remove'
|
||||||
package_provide_tput='ncurses-utils'
|
package_provide_tput='ncurses-utils'
|
||||||
package_provide_bsdtar='bsdtar'
|
|
||||||
elif [[ "$(type -P pacman)" ]]; then
|
elif [[ "$(type -P pacman)" ]]; then
|
||||||
PACKAGE_MANAGEMENT_INSTALL='pacman -Syu --noconfirm'
|
PACKAGE_MANAGEMENT_INSTALL='pacman -Syu --noconfirm'
|
||||||
PACKAGE_MANAGEMENT_REMOVE='pacman -Rsn'
|
PACKAGE_MANAGEMENT_REMOVE='pacman -Rsn'
|
||||||
package_provide_tput='ncurses'
|
package_provide_tput='ncurses'
|
||||||
package_provide_bsdtar='libarchive'
|
|
||||||
else
|
else
|
||||||
echo "error: The script does not support the package manager in this operating system."
|
echo "error: The script does not support the package manager in this operating system."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -307,7 +302,7 @@ download_v2ray() {
|
||||||
}
|
}
|
||||||
|
|
||||||
decompression() {
|
decompression() {
|
||||||
if ! bsdtar -C "$TMP_DIRECTORY" -xf "$1"; then
|
if ! unzip -q "$1" -d "$TMP_DIRECTORY"; then
|
||||||
echo 'error: V2Ray decompression failed.'
|
echo 'error: V2Ray decompression failed.'
|
||||||
"rm" -r "$TMP_DIRECTORY"
|
"rm" -r "$TMP_DIRECTORY"
|
||||||
echo "removed: $TMP_DIRECTORY"
|
echo "removed: $TMP_DIRECTORY"
|
||||||
|
@ -531,7 +526,7 @@ main() {
|
||||||
echo 'warn: Install V2Ray from a local file, but still need to make sure the network is available.'
|
echo 'warn: Install V2Ray from a local file, but still need to make sure the network is available.'
|
||||||
echo -n 'warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
|
echo -n 'warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
|
||||||
read -r
|
read -r
|
||||||
install_software "$package_provide_bsdtar" 'bsdtar'
|
install_software 'unzip' 'unzip'
|
||||||
decompression "$LOCAL_FILE"
|
decompression "$LOCAL_FILE"
|
||||||
else
|
else
|
||||||
# Normal way
|
# Normal way
|
||||||
|
@ -546,7 +541,7 @@ main() {
|
||||||
echo "removed: $TMP_DIRECTORY"
|
echo "removed: $TMP_DIRECTORY"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
install_software "$package_provide_bsdtar" 'bsdtar'
|
install_software 'unzip' 'unzip'
|
||||||
decompression "$ZIP_FILE"
|
decompression "$ZIP_FILE"
|
||||||
elif [[ "$NUMBER" -eq '1' ]]; then
|
elif [[ "$NUMBER" -eq '1' ]]; then
|
||||||
echo "info: No new version. The current version of V2Ray is $CURRENT_VERSION ."
|
echo "info: No new version. The current version of V2Ray is $CURRENT_VERSION ."
|
||||||
|
|
Loading…
Reference in New Issue