From 391e1f056b847dc203e534d00939c2d6f0831a29 Mon Sep 17 00:00:00 2001 From: juewuy Date: Fri, 9 Feb 2024 11:21:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=89=88=E5=88=97=E8=A1=A8=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=9C=A8=E7=BA=BF=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/getdate.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/getdate.sh b/scripts/getdate.sh index f9b6448..061465c 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -359,7 +359,11 @@ EOF echo -e "\033[33m未找到本地模版,尝试在线获取!\033[0m" mkdir -p ${CRASHDIR}/providers ${CRASHDIR}/start.sh get_bin ${CRASHDIR}/providers/${provider_temp_file} rules/${coretype}_providers/${provider_temp_file} - [ "$?" != 0 ] && echo -e "\033[31m下载失败,已退出!\033[0m" && exit + [ "$?" != 0 ] && { + echo -e "\033[31m下载失败,请尝试更换安装源!\033[0m" + setserver + setproviders + } fi #生成proxy_providers模块 mkdir -p ${TMPDIR}/providers @@ -425,7 +429,11 @@ EOF echo -e "\033[33m未找到本地模版,尝试在线获取!\033[0m" mkdir -p ${CRASHDIR}/providers ${CRASHDIR}/start.sh get_bin ${CRASHDIR}/providers/${provider_temp_file} rules/${coretype}_providers/${provider_temp_file} - [ "$?" != 0 ] && echo -e "\033[31m下载失败,已退出!\033[0m" && exit + [ "$?" != 0 ] && { + echo -e "\033[31m下载失败,请尝试更换安装源!\033[0m" + setserver + setproviders + } fi #生成outbound_providers模块 mkdir -p ${TMPDIR}/providers @@ -566,6 +574,15 @@ setproviders(){ #自定义providers setproviders ;; c) + [ ! -s ${CRASHDIR}/configs/${coretype}_providers.list ] && { + echo -e "\033[32m正在在线获取模版列表!\033[0m" + ${CRASHDIR}/start.sh get_bin ${CRASHDIR}/configs/${coretype}_providers.list rules/${coretype}_providers/${coretype}_providers.list + [ "$?" != 0 ] && { + echo -e "\033[31m下载失败,请尝试更换安装源!\033[0m" + setserver + setproviders + } + } if [ -z "$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg)" ];then provider_temp_des=$(sed -n "1 p" ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print $1}') else @@ -921,7 +938,7 @@ set_core_config(){ #配置文件功能 echo ----------------------------------------------- echo -e " 1 在线\033[32m生成$crashcore配置文件\033[0m" echo -e " 2 在线\033[33m获取完整配置文件\033[0m" - echo -e " 3 本地\033[32m生成providers配置文件\033[0m" + echo -e " 3 本地\033[32m生成providers配置文件\033[0m(实验性)\033[0m" echo -e " 4 本地\033[33m上传完整配置文件\033[0m" echo -e " 5 设置\033[36m自动更新\033[0m" echo -e " 6 \033[32m自定义\033[0m配置文件"