Skip to content

Commit

Permalink
feat(脚本): 添加更新geosite、geoip
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed Jan 16, 2023
1 parent ec6a56a commit 9461691
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ customPortFunction() {
fi
fi

if [[ -z "${currentPort}" && -z "${customPort}" ]] || [[ "${historyCustomPortStatus}" == "n" ]];then
if [[ -z "${currentPort}" && -z "${customPort}" ]] || [[ "${historyCustomPortStatus}" == "n" ]]; then
echo
echoContent yellow "请输入端口[默认: 443],如自定义端口,只允许使用DNS申请证书[回车使用默认]"
read -r -p "端口:" customPort
Expand Down Expand Up @@ -1684,6 +1684,7 @@ v2rayVersionManageMenu() {
echoContent yellow "3.关闭v2ray-core"
echoContent yellow "4.打开v2ray-core"
echoContent yellow "5.重启v2ray-core"
echoContent yellow "6.更新geosite、geoip"
echoContent red "=============================================================="
read -r -p "请选择:" selectV2RayType
if [[ "${selectV2RayType}" == "1" ]]; then
Expand All @@ -1710,6 +1711,8 @@ v2rayVersionManageMenu() {
handleV2Ray start
elif [[ "${selectV2RayType}" == "5" ]]; then
reloadCore
elif [[ "${selectXrayType}" == "6" ]]; then
updateGeoSite
fi
}

Expand All @@ -1728,6 +1731,7 @@ xrayVersionManageMenu() {
echoContent yellow "4.关闭Xray-core"
echoContent yellow "5.打开Xray-core"
echoContent yellow "6.重启Xray-core"
echoContent yellow "7.更新geosite、geoip"
echoContent red "=============================================================="
read -r -p "请选择:" selectXrayType
if [[ "${selectXrayType}" == "1" ]]; then
Expand Down Expand Up @@ -1758,8 +1762,24 @@ xrayVersionManageMenu() {
handleXray start
elif [[ "${selectXrayType}" == "6" ]]; then
reloadCore
elif [[ "${selectXrayType}" == "7" ]]; then
updateGeoSite
fi

}

# 更新 geosite
updateGeoSite() {
echoContent yellow "\n来源 https://github.com/Loyalsoldier/v2ray-rules-dat"

version=$(curl -s https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases | jq -r '.[]|.tag_name' | head -1)
echoContent skyBlue "------------------------Version-------------------------------"
echo "version:${version}"
wget -c -q --show-progress -P ${configPath}../ "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${version}/geosite.data"
wget -c -q --show-progress -P ${configPath}../ "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/${version}/geoip.data"
reloadCore
echoContent green " ---> 更新完毕"

}
# 更新V2Ray
updateV2Ray() {
Expand Down Expand Up @@ -5415,7 +5435,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者:mack-a"
echoContent green "当前版本:v2.6.18"
echoContent green "当前版本:v2.6.19"
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus
Expand Down

0 comments on commit 9461691

Please sign in to comment.