Merge branch 'master' of https://github.com/juewuy/ShellCrash into master

# Conflicts:
#	scripts/clash.sh
#	scripts/getdate.sh
This commit is contained in:
juewuy
2024-01-05 13:35:15 +08:00
2 changed files with 42 additions and 37 deletions

View File

@@ -746,7 +746,6 @@ gettar(){
mkdir -p $CRASHDIR > /dev/null
tar -zxvf "$TMPDIR/clashfm.tar.gz" -C $CRASHDIR/ || tar -zxvf "$TMPDIR/clashfm.tar.gz" --no-same-owner -C $CRASHDIR/
if [ $? -ne 0 ];then
rm -rf $TMPDIR/clashfm.tar.gz
echo -e "\033[33m文件解压失败\033[0m"
error_down
else
@@ -754,6 +753,7 @@ gettar(){
echo -e "\033[32m脚本更新成功\033[0m"
fi
fi
rm -rf $TMPDIR/clashfm.tar.gz
exit
}
getsh(){
@@ -820,7 +820,7 @@ getcore(){
echo -e "\033[31m核心文件下载失败\033[0m"
rm -rf $TMPDIR/core.new
[ -z "$custcorelink" ] && error_down
else
else=
chmod +x $TMPDIR/core.new
$CRASHDIR/start.sh stop
if [ "$crashcore" = singbox ];then
@@ -965,6 +965,7 @@ getgeo(){
sleep 1
}
setgeo(){
source $CFG_PATH > /dev/null
[ -n "$cn_mini.mmdb_v" ] && geo_type_des=精简版 || geo_type_des=全球版
echo -----------------------------------------------
echo -e "\033[36m请选择需要更新的GeoIP/CN_IP数据库\033[0m"
@@ -979,17 +980,22 @@ setgeo(){
echo " 0 返回上级菜单"
echo -----------------------------------------------
read -p "请输入对应数字 > " num
if [ "$num" = '1' ]; then
case "$num" in
0)
;;
1)
geotype=Country.mmdb
geoname=Country.mmdb
getgeo
setgeo
elif [ "$num" = '2' ]; then
;;
2)
geotype=cn_mini.mmdb
geoname=Country.mmdb
getgeo
setgeo
elif [ "$num" = '3' ]; then
;;
3)
if [ "$cn_ip_route" = "已开启" ]; then
geotype=china_ip_list.txt
geoname=cn_ip.txt
@@ -1000,7 +1006,8 @@ setgeo(){
sleep 1
fi
setgeo
elif [ "$num" = '4' ]; then
;;
4)
if [ "$cn_ipv6_route" = "已开启" -a "$ipv6_redir" = "已开启" ]; then
geotype=china_ipv6_list.txt
geoname=cn_ipv6.txt
@@ -1011,7 +1018,8 @@ setgeo(){
sleep 1
fi
setgeo
elif [ "$num" = '5' ]; then
;;
5)
if [ "$crashcore" = "meta" ]; then
geotype=geosite.dat
geoname=GeoSite.dat
@@ -1022,9 +1030,11 @@ setgeo(){
sleep 1
fi
setgeo
else
update
fi
;;
*)
errornum
;;
esac
}
getdb(){
@@ -1125,23 +1135,18 @@ setdb(){
if [ "$num" = '1' ]; then
db_type=clashdb
dbdir
getdb
elif [ "$num" = '2' ]; then
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
db_type=meta_xd
dbdir
getdb
elif [ "$num" = '6' ]; then
read -p "确认卸载本地面板?(1/0) > " res
if [ "$res" = 1 ];then