mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 11:42:18 +08:00
v1.0.0beta3
~新增纯净模式 ~新增用于纯净模式的PAC生成功能 ~新增重置配置文件功能 ~本地DNS服务默认设置调整为不启用
This commit is contained in:
parent
6aa9077907
commit
564c831c37
BIN
bin/Country.mmdb
BIN
bin/Country.mmdb
Binary file not shown.
Binary file not shown.
|
@ -1,2 +1,2 @@
|
|||
GeoIP_v=20200827
|
||||
versionsh=1.0.0beta2
|
||||
versionsh=1.0.0beta3
|
||||
GeoIP_v=20200908
|
||||
|
|
|
@ -263,7 +263,7 @@ clashcfg(){
|
|||
[ -z "$skip_cert" ] && skip_cert=未开启
|
||||
[ -z "$common_ports" ] && common_ports=未开启
|
||||
[ -z "$dns_mod" ] && dns_mod=redir_host
|
||||
[ -z "$dns_over" ] && dns_over=未开启
|
||||
[ -z "$dns_over" ] && dns_over=已开启
|
||||
if [ -z "$(cat $clashdir/mac)" ]; then
|
||||
mac_return=未开启
|
||||
else
|
||||
|
@ -303,6 +303,8 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
|||
echo " 3 混合模式: 仅使用Tun转发UPD流量"
|
||||
echo " CPU和内存占用较高"
|
||||
echo " 不推荐使用redir-host"
|
||||
echo " 4 纯净模式: 不设置iptables静态路由"
|
||||
echo " 必须手动配置http/sock5代理"
|
||||
echo " 0 返回上级菜单"
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" ]; then
|
||||
|
@ -327,7 +329,20 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
|||
echo -e "\033[31m当前核心不支持开启Tun模式!请先切换clash核心!!!\033[0m"
|
||||
clashcfg
|
||||
fi
|
||||
redir_mod=混合模式
|
||||
redir_mod=混合模式
|
||||
elif [[ $num == 4 ]]; then
|
||||
redir_mod=纯净模式
|
||||
host=$(ubus call network.interface.lan status | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[32m已经设置为纯净模式!\033[0m"
|
||||
echo -e "\033[33m当前模式必须手动在设备WiFi或应用中配置HTTP或sock5代理\033[0m"
|
||||
echo -e "HTTP/SOCK5代理服务器地址:\033[30;47m$host\033[0m;端口均为:\033[30;47m7890\033[0m"
|
||||
echo -e "\033[31m也可以使用PAC自动代理文件,具体使用方法请自行搜索\033[0m"
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
read -p "是否配置自动代理PAC文件(1/0) > " res
|
||||
if [ "$res" = 1 ]; then
|
||||
source $clashdir/getdate.sh && catpac
|
||||
fi
|
||||
else
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[31m请输入正确的数字!\033[0m"
|
||||
|
@ -513,6 +528,7 @@ echo -e " 1 不修饰config.yaml: \033[36m$modify_yaml\033[0m ————用
|
|||
echo -e " 2 启用ipv6支持: \033[36m$ipv6_support\033[0m ————实验性且不兼容Fake_ip"
|
||||
echo -e " 3 使用保守方式启动: \033[36m$start_old\033[0m ————切换时会停止clash服务"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 8 \033[31m重置\033[0m配置文件"
|
||||
echo -e " 9 \033[32m重启\033[0mclash服务"
|
||||
echo -e " 0 返回上级菜单 \033[0m"
|
||||
echo -----------------------------------------------
|
||||
|
@ -571,7 +587,17 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
|||
source $clashdir/start.sh && stop_old
|
||||
fi
|
||||
clashadv
|
||||
|
||||
|
||||
elif [[ $num == 8 ]]; then
|
||||
read -p "确认重置配置文件?(1/0) > " res
|
||||
if [ "$res" = "1" ];then
|
||||
echo "versionsh_l=$versionsh_l" > $ccfg
|
||||
echo "start_time=$start_time" >> $ccfg
|
||||
echo "#标识clash运行状态的文件,不明勿动!" >> $ccfg
|
||||
echo -e "\033[33m配置文件已重置,请重新运行脚本!\033[0m"
|
||||
exit
|
||||
fi
|
||||
clashadv
|
||||
|
||||
elif [[ $num == 9 ]]; then
|
||||
clashstart
|
||||
|
@ -597,6 +623,7 @@ echo -e " 1 更新\033[36m管理脚本\033[0m"
|
|||
echo -e " 2 切换\033[33mclash核心\033[0m"
|
||||
echo -e " 3 更新\033[32mGeoIP数据库\033[0m"
|
||||
echo -e " 4 安装本地\033[35mDashboard\033[0m面板"
|
||||
echo -e " 5 生成本地PAC文件(需先安装本地面板)"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 8 切换\033[36m安装源\033[0m地址"
|
||||
echo -e " 9 \033[31m卸载\033[34mClash for Miwfi\033[0m"
|
||||
|
@ -624,6 +651,11 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
|||
source $clashdir/getdate.sh
|
||||
getdb
|
||||
|
||||
elif [[ $num == 5 ]]; then
|
||||
source $clashdir/getdate.sh
|
||||
catpac
|
||||
update
|
||||
|
||||
elif [[ $num == 8 ]]; then
|
||||
source $clashdir/getdate.sh
|
||||
setserver
|
||||
|
@ -850,7 +882,8 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
|||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[30;47m这里是测试命令菜单\033[0m"
|
||||
echo -e "\033[33m如遇问题尽量运行相应命令后截图发群\033[0m"
|
||||
echo -e "磁盘占用/所在目录:$(du -h $clashdir)"
|
||||
echo -e "磁盘占用/所在目录:"
|
||||
du -h $clashdir
|
||||
echo -----------------------------------------------
|
||||
echo " 1 查看clash运行时的报错信息"
|
||||
echo " 2 查看系统DNS端口(:53)占用 "
|
||||
|
|
|
@ -23,8 +23,8 @@ start_service() {
|
|||
procd_close_instance
|
||||
#修改iptables规则使流量进入clash
|
||||
stop_iptables
|
||||
start_dns
|
||||
[ "$redir_mod" != "Tun模式" ] && start_redir
|
||||
[ "$redir_mod" != "纯净模式" ] && start_dns
|
||||
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
|
||||
#标记启动时间
|
||||
mark_time
|
||||
#标记启动方式
|
||||
|
|
|
@ -247,6 +247,8 @@ if [ -n $Url ];then
|
|||
echo -e " 2 \033[36m添加/修改节点过滤关键字 \033[47;30m$exclude\033[0m"
|
||||
echo -e " 3 \033[33m选取配置规则模版\033[0m"
|
||||
echo -e " 4 \033[0m选取在线生成服务器\033[0m"
|
||||
echo -e " 5 \033[0m跳过本地证书验证: \033[36m$skip_cert\033[0m ————解决节点证书验证错误"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 0 \033[31m取消导入\033[0m并返回上级菜单"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
|
@ -271,6 +273,19 @@ if [ -n $Url ];then
|
|||
elif [ "$num" = '4' ]; then
|
||||
linkserver
|
||||
linkset
|
||||
elif [ "$num" = '5' ]; then
|
||||
sed -i '/skip_cert*/'d $ccfg
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if [ "$skip_cert" = "未开启" ] > /dev/null 2>&1; then
|
||||
sed -i "1i\skip_cert=已开启" $ccfg
|
||||
#echo -e "\033[33m已设为开启跳过本地证书验证!!\033[0m"
|
||||
skip_cert=已开启
|
||||
else
|
||||
sed -i "1i\skip_cert=未开启" $ccfg
|
||||
#echo -e "\033[33m已设为禁止跳过本地证书验证!!\033[0m"
|
||||
skip_cert=未开启
|
||||
fi
|
||||
linkset
|
||||
else
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[31m请输入正确的数字!\033[0m"
|
||||
|
@ -603,6 +618,37 @@ fi
|
|||
|
||||
update
|
||||
}
|
||||
catpac(){
|
||||
#检测目录
|
||||
[ ! -d /www/clash -a ! -d $clashdir/ui ]&&echo 未检测到本地Dashboard面板,请先安装面板!&&sleep 1&&getdb
|
||||
host=$(ubus call network.interface.lan status | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
|
||||
[ -d /www/clash ]&&dir="/www/clash"&&pac=http://$host/clash/pac
|
||||
[ -d $clashdir/ui ]&&dir="$clashdir/ui"&&pac=http://$host:9999/ui/pac
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[30;47m生成用于设备WIFI或浏览器的自动PAC代理文件\033[0m"
|
||||
echo -e "\033[33m非纯净模式不推荐使用此功能\033[0m"
|
||||
[ -f $dir/pac ]&&echo -e "PAC地址:\033[32m$pac\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 生成PAC文件"
|
||||
echo -e " 2 清除PAC文件"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 0 返回上级菜单"
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ "$num" = '1' ]; then
|
||||
echo 'function FindProxyForURL(url, host) {' > $dir/pac
|
||||
echo " return \"SOCKS5 $host:7890; PROXY $host:7890; DIRECT\";" >> $dir/pac
|
||||
echo '}' >> $dir/pac
|
||||
echo -e "\033[33mPAC文件已生成!\033[0m"
|
||||
echo -e "PAC地址:\033[32m$pac\033[0m"
|
||||
echo "使用教程:https://baike.baidu.com/item/PAC/16292100"
|
||||
sleep 2
|
||||
elif [[ $num == 2 ]]; then
|
||||
rm -rf $dir/pac
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33mPAC文件已清除!\033[0m"
|
||||
sleep 1
|
||||
fi
|
||||
}
|
||||
setserver(){
|
||||
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -167,8 +167,8 @@ start_old(){
|
|||
$clashdir/clash -d $clashdir> /dev/null &
|
||||
#修改iptables规则使流量进入clash
|
||||
stop_iptables
|
||||
start_dns
|
||||
[ "$redir_mod" != "Tun模式" ] && start_redir
|
||||
[ "$redir_mod" != "纯净模式" ] && start_dns
|
||||
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
|
||||
#标记启动时间
|
||||
mark_time
|
||||
#创建守护进程
|
||||
|
|
Loading…
Reference in New Issue
Block a user