From 523528b700ff483da1c83698531b3725b757116a Mon Sep 17 00:00:00 2001 From: juewuy Date: Thu, 17 Mar 2022 23:26:50 +0800 Subject: [PATCH] =?UTF-8?q?v1.5.6=20~=E5=A2=9E=E5=8A=A0GeoSite=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E6=89=8B=E5=8A=A8=E6=9B=B4=E6=96=B0=20~SSH?= =?UTF-8?q?=E5=9B=BA=E5=8C=96=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/clash.sh | 4 +++- scripts/getdate.sh | 9 +++++++-- scripts/start.sh | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/clash.sh b/scripts/clash.sh index 5234112..48ed436 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -1232,15 +1232,17 @@ tools(){ echo -e "\033[33m本功能使用软件命令进行固化不保证100%成功!\033[0m" echo -e "本功能需依赖clash服务,请确保clash为开机启动状态!" echo -e "\033[33m如有问题请加群反馈:\033[36;4mhttps://t.me/clashfm\033[0m" + read -p "请输入需要还原的SSH密码(不影响当前密码,回车可跳过) > " mi_autoSSH_pwd mi_autoSSH=已启用 if [ "$systype" = "mi_snapshot" ];then cp -f /etc/dropbear/dropbear_rsa_host_key $clashdir/dropbear_rsa_host_key 2>/dev/null echo -e "\033[32m检测当前为小米镜像化系统,已将SSH秘钥备份到脚本安装目录!\033[0m" echo -e "\033[32mClash会在启动时自动还原已备份的秘钥文件!\033[0m" fi - sleep 2 + echo -e "\033[32m设置成功!\033[0m" fi setconfig mi_autoSSH $mi_autoSSH + setconfig mi_autoSSH_pwd $mi_autoSSH_pwd tools else errornum diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 4600d34..511c61a 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -536,13 +536,15 @@ getgeo(){ } setgeo(){ echo ----------------------------------------------- - [ "$geotype" = "Country.mmdb" ] && geo_type=全球版 || geo_type=精简版 + [ "$geotype" = "cn_mini.mmdb" ] && geo_type=精简版 || geo_type=全球版 [ -n "$geo_type" ] && echo -e "当前使用的是\033[47;30m$geo_type数据库\033[0m" echo -e "\033[36m请选择需要更新/切换的GeoIP/CN_IP数据库:\033[0m" echo ----------------------------------------------- echo -e " 1 由\033[32malecthw\033[0m提供的全球版GeoIP数据库(约6mb)" echo -e " 2 由\033[32mHackl0us\033[0m提供的精简版CN-IP数据库(约0.2mb)" echo -e " 3 由\033[32m17mon\033[0m提供的CN-IP文件(需启用CN_IP绕过内核功能,约0.2mb)" + [ "$clashcore" = "clash.meta" ] && \ + echo -e " 4 由\033[32mLoyalsoldier\033[0m提供的GeoSite数据库(限Meta内核,约4.5mb)" echo " 0 返回上级菜单" echo ----------------------------------------------- read -p "请输入对应数字 > " num @@ -564,6 +566,10 @@ setgeo(){ echo -e "\033[31m未开启绕过内核功能,无需更新CN-IP文件!!\033[0m" sleep 1 fi + elif [ "$num" = '4' ]; then + geotype=geosite.dat + geoname=geosite.dat + getgeo else update fi @@ -612,7 +618,6 @@ getdb(){ setconfig hostdir \'$hostdir\' echo ----------------------------------------------- echo -e "\033[32m面板安装成功!\033[0m" - echo -e "\033[36m请使用\033[32;4mhttp://$host$hostdir\033[0;36m访问面板\033[0m" rm -rf /tmp/clashdb.tar.gz sleep 1 fi diff --git a/scripts/start.sh b/scripts/start.sh index 9f6c62d..1102928 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -129,6 +129,7 @@ autoSSH(){ [ -z "$(pidof dropbear)" -o -z "$(netstat -ntul | grep :22)" ] && { sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear /etc/init.d/dropbear restart + [ -n "$mi_autoSSH_pwd" ] && echo -e "$mi_autoSSH_pwd\n$mi_autoSSH_pwd" | passwd root } #备份还原SSH秘钥 [ -f $clashdir/dropbear_rsa_host_key ] && ln -sf $clashdir/dropbear_rsa_host_key /etc/dropbear/dropbear_rsa_host_key