curl header add no cache

pull/519/head
233boy 6 years ago
parent 12043c2a4b
commit 077585ceb4
  1. 16
      v2ray.sh

@ -10,7 +10,7 @@ none='\e[0m'
# Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1
_version="v2.42"
_version="v2.43"
cmd="apt-get"
@ -2950,7 +2950,19 @@ update_v2ray() {
fi
}
update_v2ray.sh() {
local latest_version=$(curl -s -L "https://raw.githubusercontent.com/233boy/v2ray/master/v2ray.sh?r=$RANDOM" | grep '_version' -m1 | cut -d\" -f2)
local latest_version=$(curl -H 'Cache-Control: no-cache' -s -L "https://raw.githubusercontent.com/233boy/v2ray/master/v2ray.sh" | grep '_version' -m1 | cut -d\" -f2)
if [[ ! $latest_version ]]; then
echo
echo -e " $red获取 V2Ray 最新版本失败!!!$none"
echo
echo -e " 请尝试执行如下命令: $green echo 'nameserver 8.8.8.8' >/etc/resolv.conf $none"
echo
echo " 然后再继续...."
echo
exit 1
fi
if [[ $latest_version == $_version ]]; then
echo
echo -e "$green 木有发现新版本 $none"

Loading…
Cancel
Save