From a2a245bbd043ab41f403f90bec9d0b320c3724d8 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sun, 29 May 2022 11:42:48 +0800 Subject: [PATCH] =?UTF-8?q?~=E5=A2=9E=E5=8A=A0=E6=9B=B4=E5=A4=9A=E7=9A=84?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E9=9D=A2=E6=9D=BF=E9=80=89=E6=8B=A9=20~?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DIP=E5=9C=B0=E5=9D=80=E5=BA=93=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E9=97=AE=E9=A2=98=20~=E5=A2=9E=E5=8A=A0=E5=9F=BA?= =?UTF-8?q?=E4=BA=8Edoh=E7=9A=84=E9=BB=98=E8=AE=A4dns=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/bin_update.yml | 26 ++++++++++++++++++++++++-- scripts/getdate.sh | 28 +++++++++++++++++++--------- scripts/start.sh | 6 +++--- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/.github/workflows/bin_update.yml b/.github/workflows/bin_update.yml index 0029e9e..ac15d6a 100644 --- a/.github/workflows/bin_update.yml +++ b/.github/workflows/bin_update.yml @@ -34,9 +34,13 @@ jobs: run: | cd \bin echo 下载官方面板 - curl -kfSL -o clashdb.zip https://github.com/MetaCubeX/clash-dashboard/archive/gh-pages.zip + curl -kfSL -o clashdb.zip https://github.com/Dreamacro/clash-dashboard/archive/gh-pages.zip + echo 下载Meta面板 + curl -kfSL -o meta_db.zip https://github.com/MetaCubeX/clash-dashboard/archive/gh-pages.zip echo 下载yacd面板 - curl -kfSL -o yacd.zip https://github.com/haishanh/yacd/archive/gh-pages.zip + curl -kfSL -o yacd.zip https://github.com/haishanh/yacd/archive/gh-pages.zip + echo 下载meta魔改yacd面板 + curl -kfSL -o meta_yacd.zip https://github.com/MetaCubeX/yacd/archive/gh-pages.zip echo 解压缩 unzip -o clashdb.zip > /dev/null unzip -o yacd.zip > /dev/null @@ -51,8 +55,26 @@ jobs: tar -zcvf yacd.tar.gz * > /dev/null mv -f yacd.tar.gz ../ cd .. + + echo 解压缩 + unzip -o meta_db.zip > /dev/null + unzip -o meta_yacd.zip > /dev/null + cd \clash-dashboard-gh-pages + tar -zcvf meta_db.tar.gz * > /dev/null + mv -f meta_db.tar.gz ../ + cd .. + cd \yacd-gh-pages + echo yacd特殊处理 + find -name '*.map' | xargs rm -rf + rm -rf report.html + tar -zcvf meta_yacd.tar.gz * > /dev/null + mv -f meta_yacd.tar.gz ../ + cd .. + rm -rf clashdb.zip rm -rf yacd.zip + rm -rf meta_db.zip + rm -rf meta_yacd.zip rm -rf \clash-dashboard-gh-pages rm -rf \yacd-gh-pages echo 面板更新完成! diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 16d1a93..319c108 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -517,7 +517,7 @@ setcore(){ getgeo(){ echo ----------------------------------------------- echo 正在从服务器获取数据库文件………… - $clashdir/start.sh webget /tmp/$geoname $update_url/bin/$geo_type + $clashdir/start.sh webget /tmp/$geoname $update_url/bin/$geotype if [ "$?" = "1" ];then echo ----------------------------------------------- echo -e "\033[31m文件下载失败!\033[0m" @@ -529,7 +529,7 @@ getgeo(){ Geo_v=$GeoIP_v setconfig Geo_v $GeoIP_v if [ "$geoname" = "Country.mmdb" ];then - geotype=$geo_type + geotype=$geotype setconfig geotype $geotype fi fi @@ -548,16 +548,16 @@ setgeo(){ echo ----------------------------------------------- read -p "请输入对应数字 > " num if [ "$num" = '1' ]; then - geo_type=Country.mmdb + geotype=Country.mmdb geoname=Country.mmdb getgeo elif [ "$num" = '2' ]; then - geo_type=cn_mini.mmdb + geotype=cn_mini.mmdb geoname=Country.mmdb getgeo elif [ "$num" = '3' ]; then if [ "$cn_ip_route" = "已开启" ]; then - geo_type=china_ip_list.txt + geotype=china_ip_list.txt geoname=cn_ip.txt getgeo else @@ -566,7 +566,7 @@ setgeo(){ sleep 1 fi elif [ "$num" = '4' ]; then - geo_type=geosite.dat + geotype=geosite.dat geoname=geosite.dat getgeo else @@ -653,8 +653,10 @@ setdb(){ echo -e "请选择面板\033[33m安装类型:\033[0m" echo ----------------------------------------------- echo -e " 1 安装\033[32m官方面板\033[0m(约500kb)" - echo -e " 2 安装\033[32mYacd面板\033[0m(约1.1mb)" - echo -e " 3 卸载\033[33m本地面板\033[0m" + echo -e " 2 安装\033[32mMeta面板\033[0m(约800kb)" + echo -e " 3 安装\033[32mYacd面板\033[0m(约1.1mb)" + echo -e " 4 安装\033[32mYacd-Meta魔改面板\033[0m(约1.5mb)" + echo -e " 5 卸载\033[33m本地面板\033[0m" echo " 0 返回上级菜单" read -p "请输入对应数字 > " num @@ -663,10 +665,18 @@ setdb(){ dbdir getdb elif [ "$num" = '2' ]; then - db_type=yacd + db_type=meta_db dbdir getdb elif [ "$num" = '3' ]; then + db_type=yacd + dbdir + getdb + elif [ "$num" = '4' ]; then + db_type=meta_yacd + dbdir + getdb + elif [ "$num" = '5' ]; then read -p "确认卸载本地面板?(1/0) > " res if [ "$res" = 1 ];then rm -rf /www/clash diff --git a/scripts/start.sh b/scripts/start.sh index 7e8c6f9..cff7d74 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -300,7 +300,8 @@ modify_yaml(){ fi exper='experimental: {ignore-resolve-fail: true, interface-name: en0}' #dns配置 - dns_default='114.114.114.114, 223.5.5.5, https://1.0.0.1/dns-query, https://223.5.5.5/dns-query' + [ "$clashcore" = 'clash.meta' ] && dns_default_meta=', https://1.0.0.1/dns-query, https://223.5.5.5/dns-query' + dns_default="114.114.114.114, 223.5.5.5$dns_default_meta" if [ -f $clashdir/fake_ip_filter ];then while read line;do fake_ft_ad=$fake_ft_ad,\"$line\" @@ -765,8 +766,7 @@ bfstart(){ mv $clashdir/Country.mmdb $bindir/Country.mmdb else logger "未找到GeoIP数据库,正在下载!" 33 - [ -z "$geotype" ] && geotype=cn_mini.mmdb - $0 webget $bindir/Country.mmdb $update_url/bin/$geotype + $0 webget $bindir/Country.mmdb $update_url/bin/cn_mini.mmdb [ "$?" = "1" ] && rm -rf $bindir/Country.mmdb && logger "数据库下载失败,已退出!" 31 && exit 1 Geo_v=$(date +"%Y%m%d") setconfig Geo_v $Geo_v