fix v2ray download error!
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
_get_latest_version() {
|
_get_latest_version() {
|
||||||
v2ray_latest_ver="$(curl -H 'Cache-Control: no-cache' -s https://api.github.com/repos/v2ray/v2ray-core/releases/latest | grep 'tag_name' | cut -d\" -f4)"
|
v2ray_repos_url="https://api.github.com/repos/v2ray/v2ray-core/releases/latest?v=$RANDOM"
|
||||||
|
v2ray_latest_ver="$(curl -s $v2ray_repos_url | grep 'tag_name' | cut -d\" -f4)"
|
||||||
|
|
||||||
if [[ ! $v2ray_latest_ver ]]; then
|
if [[ ! $v2ray_latest_ver ]]; then
|
||||||
echo
|
echo
|
||||||
@@ -14,7 +15,7 @@ _get_latest_version() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_download_v2ray_file() {
|
_download_v2ray_file() {
|
||||||
_get_latest_version
|
[[ ! $v2ray_latest_ver ]] && _get_latest_version
|
||||||
v2ray_tmp_file="/tmp/v2ray.zip"
|
v2ray_tmp_file="/tmp/v2ray.zip"
|
||||||
v2ray_download_link="https://github.com/v2ray/v2ray-core/releases/download/$v2ray_latest_ver/v2ray-linux-${v2ray_bit}.zip"
|
v2ray_download_link="https://github.com/v2ray/v2ray-core/releases/download/$v2ray_latest_ver/v2ray-linux-${v2ray_bit}.zip"
|
||||||
|
|
||||||
@@ -26,7 +27,9 @@ _download_v2ray_file() {
|
|||||||
|
|
||||||
unzip -o $v2ray_tmp_file -d "/usr/bin/v2ray/"
|
unzip -o $v2ray_tmp_file -d "/usr/bin/v2ray/"
|
||||||
chmod +x /usr/bin/v2ray/{v2ray,v2ctl}
|
chmod +x /usr/bin/v2ray/{v2ray,v2ctl}
|
||||||
echo "alias v2ray=$_v2ray_sh" >>/root/.bashrc
|
if [[ ! $(cat /root/.bashrc | grep v2ray) ]]; then
|
||||||
|
echo "alias v2ray=$_v2ray_sh" >>/root/.bashrc
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_install_v2ray_service() {
|
_install_v2ray_service() {
|
||||||
|
2
v2ray.sh
2
v2ray.sh
@@ -10,7 +10,7 @@ none='\e[0m'
|
|||||||
# Root
|
# Root
|
||||||
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
|
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
|
||||||
|
|
||||||
_version="v3.31"
|
_version="v3.32"
|
||||||
|
|
||||||
cmd="apt-get"
|
cmd="apt-get"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user