~增加GeoSite数据库手动更新
~SSH固化功能支持密码设置
This commit is contained in:
juewuy
2022-03-17 23:26:50 +08:00
parent 716ee61799
commit 523528b700
3 changed files with 11 additions and 3 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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