mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 11:42:18 +08:00
v1.6.11c
~日志功能优化,增加推送通道 ·Telegram推送 ·Bark推送 ·Pushover推送 ~新手引导优化 ~ipv6支持优化 ~优化内核说明、移除.net内核 ~修复日志功能相关bug ~修复ipv6功能部分bug
This commit is contained in:
parent
addccfcb12
commit
c6d17d5742
29
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
29
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
name: Bug report
|
||||
description: Create a report to help us improve
|
||||
title: "[Bug] "
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: ensure
|
||||
attributes:
|
||||
label: Verify steps
|
||||
description: "
|
||||
在提交之前,请确认
|
||||
Please verify that you've followed these steps
|
||||
"
|
||||
options:
|
||||
- label: "
|
||||
我已经在 [Issue Tracker](……/) 中找过我要提出的问题
|
||||
I have searched on the [issue tracker](……/) for a related issue.
|
||||
"
|
||||
required: true
|
||||
- label: "
|
||||
我已经使用 公测版本测试过,问题依旧存在
|
||||
I have tested using the test mod, and the issue still exists.
|
||||
"
|
||||
required: true
|
||||
- label: "
|
||||
我已经仔细看过 [常见问题](https://juewuy.github.io/chang-jian-wen-ti/) 并无法自行解决问题
|
||||
I have read the [常见问题](https://juewuy.github.io/chang-jian-wen-ti/) and was unable to solve the issue.
|
||||
"
|
||||
required: true
|
||||
- label: "
|
|
@ -503,12 +503,14 @@ setipv6(){
|
|||
if [ "$ipv6_redir" = "未开启" ]; then
|
||||
echo -e "如果启用后导致部分应用加载缓慢,请关闭此功能即可恢复"
|
||||
echo -e "\033[31m除非特殊需要,否则无需开启此功能!\033[0m"
|
||||
ipv6_support=已开启
|
||||
ipv6_redir=已开启
|
||||
sleep 2
|
||||
else
|
||||
ipv6_redir=未开启
|
||||
fi
|
||||
setconfig ipv6_redir $ipv6_redir
|
||||
setconfig ipv6_support $ipv6_support
|
||||
setipv6
|
||||
;;
|
||||
3)
|
||||
|
@ -947,7 +949,7 @@ clashcfg(){
|
|||
set_redir_config
|
||||
|
||||
elif [ "$num" = 7 ]; then
|
||||
if modprobe nft_tproxy &>/dev/null;then
|
||||
if [ -n "$(lsmod | grep 'nft_tproxy')" ];then
|
||||
redir_mod=Nft混合
|
||||
else
|
||||
read -p "未检测到Tproxy模块,是否强制开启?可能导致无法联网!(1/0)" res
|
||||
|
|
|
@ -473,21 +473,21 @@ setcore(){
|
|||
###
|
||||
echo -----------------------------------------------
|
||||
[ -z "$cpucore" ] && getcpucore
|
||||
echo -e "当前clash核心:\033[47;30m $clashcore \033[46;30m$clashv\033[0m"
|
||||
echo -e "当前clash核心:\033[42;30m $clashcore \033[47;30m$clashv\033[0m"
|
||||
echo -e "当前系统处理器架构:\033[32m $cpucore \033[0m"
|
||||
echo -e "\033[33m请选择需要使用的核心版本!\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo "1 clash: 稳定,内存占用小,推荐!"
|
||||
echo "(官方正式版) 不支持Tun模式、混合模式"
|
||||
echo -e "1 \033[43;30m Clash \033[0m: \033[32m占用低\033[0m"
|
||||
echo -e " (官方基础版) \033[33m不支持Tun、Rule-set等\033[0m"
|
||||
echo -e " 说明文档: \033[36;4mhttps://lancellc.gitbook.io\033[0m"
|
||||
echo
|
||||
echo "2 clashpre: 支持Tun模式、混合模式"
|
||||
echo "(高级预览版) 内存占用更高"
|
||||
echo -e "2 \033[43;30m Clashpre \033[0m: \033[32m支持Tun、Rule-set、域名嗅探\033[0m"
|
||||
echo -e " (官方高级版) \033[33m不支持vless、hy协议\033[0m"
|
||||
echo -e " 说明文档: \033[36;4mhttps://lancellc.gitbook.io\033[0m"
|
||||
echo
|
||||
echo "3 clash.net: 支持部分vless协议"
|
||||
echo "(.net定制版) 第三方定制内核"
|
||||
echo
|
||||
echo "4 clash.meta:支持大部分vless协议"
|
||||
echo "(meta定制版) 第三方定制内核"
|
||||
echo -e "3 \033[43;30mClash.Meta\033[0m: \033[32m多功能,支持最全面\033[0m"
|
||||
echo -e " (Meta定制版) \033[33m第三方定制内核\033[0m"
|
||||
echo -e " 说明文档: \033[36;4mhttps://docs.metacubex.one\033[0m"
|
||||
echo
|
||||
echo "5 手动指定处理器架构"
|
||||
echo -----------------------------------------------
|
||||
|
@ -506,10 +506,6 @@ setcore(){
|
|||
version=$clashpre_v
|
||||
getcore
|
||||
elif [ "$num" = 3 ]; then
|
||||
clashcore=clash.net
|
||||
version=$clashnet_v
|
||||
getcore
|
||||
elif [ "$num" = 4 ]; then
|
||||
clashcore=clash.meta
|
||||
version=$meta_v
|
||||
getcore
|
||||
|
@ -1126,7 +1122,7 @@ testcommand(){
|
|||
iptables -t mangle -L PREROUTING --line-numbers
|
||||
iptables -t mangle -L clash --line-numbers
|
||||
}
|
||||
[ -n "$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')" -a "$ipv6_support" = "已开启" ] && {
|
||||
[ -n "$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')" -a "$ipv6_redir" = "已开启" ] && {
|
||||
echo -------------------Redir---------------------
|
||||
ip6tables -t nat -L PREROUTING --line-numbers
|
||||
ip6tables -t nat -L clashv6_dns --line-numbers
|
||||
|
|
|
@ -59,22 +59,22 @@ logger(){
|
|||
curl_data="-d chat_id=$chat_ID&text=$log_text"
|
||||
wget_data="--post-data=$chat_ID&text=$log_text"
|
||||
if curl --version &> /dev/null;then
|
||||
curl -kfsSl -d "chat_id=$chat_ID&text=$log_text" "$url" >/dev/null
|
||||
curl -kfsSl -d "chat_id=$chat_ID&text=$log_text" "$url" &>/dev/null
|
||||
else
|
||||
wget -Y on -q --post-data="chat_id=$chat_ID&text=$log_text" "$url"
|
||||
wget -Y on -q --post-data="chat_id=$chat_ID&text=$log_text" "$url"
|
||||
fi
|
||||
}
|
||||
[ -n "$push_bark" ] && {
|
||||
url=${push_bark}/${log_text}
|
||||
if curl --version &> /dev/null;then
|
||||
curl -kfsSl "$url" >/dev/null
|
||||
curl -kfsSl "$url" &>/dev/null
|
||||
else
|
||||
wget -Y on -q "$url"
|
||||
wget -Y on -q "$url"
|
||||
fi
|
||||
}
|
||||
[ -n "$push_Po" ] && {
|
||||
url=https://api.pushover.net/1/messages.json
|
||||
curl -kfsSl --form-string "token=$push_Po" --form-string "user=$push_Po_key" --form-string "message=$log_text" "$url" >/dev/null
|
||||
curl -kfsSl --form-string "token=$push_Po" --form-string "user=$push_Po_key" --form-string "message=$log_text" "$url" &>/dev/null
|
||||
}
|
||||
}
|
||||
croncmd(){
|
||||
|
@ -343,12 +343,12 @@ $exper
|
|||
$dns
|
||||
$sniffer_set
|
||||
store-selected: $restore
|
||||
hosts:
|
||||
EOF
|
||||
###################################
|
||||
#读取本机hosts并生成配置文件
|
||||
hosts_dir=/etc/hosts
|
||||
if [ "$redir_mod" != "纯净模式" ] && [ "$dns_no" != "已禁用" ] && [ -f $hosts_dir ];then
|
||||
echo 'hosts:' >> $tmpdir/hosts.yaml
|
||||
while read line;do
|
||||
[ -n "$(echo "$line" | grep -oE "([0-9]{1,3}[\.]){3}" )" ] && \
|
||||
[ -z "$(echo "$line" | grep -oE '^#')" ] && \
|
||||
|
@ -583,8 +583,7 @@ start_tproxy(){
|
|||
iptables -I INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1
|
||||
}
|
||||
#设置ipv6转发
|
||||
ip6_nat=$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')
|
||||
[ -n "$ip6_nat" -a "$ipv6_redir" = "已开启" ] && {
|
||||
[ "$ipv6_redir" = "已开启" ] && {
|
||||
ip -6 rule add fwmark 1 table 101
|
||||
ip -6 route add local ::/0 dev lo table 101
|
||||
ip6tables -t mangle -N clashv6
|
||||
|
@ -608,7 +607,7 @@ start_tproxy(){
|
|||
ip6tables -t mangle -A PREROUTING -p $1 $ports -j clashv6
|
||||
}
|
||||
[ "$1" = "all" ] && tproxy_set6 tcp
|
||||
#tproxy_set6 udp
|
||||
tproxy_set6 udp
|
||||
[ "$quic_rj" = 已启用 ] && {
|
||||
ip6tables -I INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1
|
||||
}
|
||||
|
@ -820,6 +819,7 @@ stop_firewall(){
|
|||
ip6tables -D INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null
|
||||
#tproxy
|
||||
ip6tables -t mangle -D PREROUTING -p tcp $ports -j clashv6 2> /dev/null
|
||||
ip6tables -t mangle -D PREROUTING -p udp $ports -j clashv6 2> /dev/null
|
||||
ip6tables -t mangle -F clashv6 2> /dev/null
|
||||
ip6tables -t mangle -X clashv6 2> /dev/null
|
||||
}
|
||||
|
@ -1082,9 +1082,10 @@ afstart(){
|
|||
cronset '#每10分钟保存节点配置' "*/10 * * * * test -n \"\$(pidof clash)\" && $clashdir/start.sh web_save #每10分钟保存节点配置"
|
||||
[ -f $clashdir/web_save ] && web_restore & #后台还原面板配置
|
||||
#自动开启SSH
|
||||
[ "$mi_autoSSH" = "已启用" ] && autoSSH 2>/dev/null
|
||||
[ "$mi_autoSSH" = "已启用" ] && autoSSH 2>/dev/null &
|
||||
{ sleep 30;logger Clash服务已启动!;} &
|
||||
else
|
||||
logger "clash服务启动失败!请查看报错信息!" 31
|
||||
logger "Clash服务启动失败!请查看报错信息!" 31
|
||||
$bindir/clash -t -d $bindir
|
||||
echo "$($bindir/clash -t -d $bindir)" >> $clashdir/log
|
||||
$0 stop
|
||||
|
@ -1129,11 +1130,10 @@ start)
|
|||
else
|
||||
start_old
|
||||
fi
|
||||
logger clash服务已启动!
|
||||
;;
|
||||
stop)
|
||||
getconfig
|
||||
logger 正在关闭clash服务……
|
||||
logger Clash服务即将关闭……
|
||||
[ -n "$(pidof clash)" ] && [ "$restore" = false ] && web_save #保存面板配置
|
||||
#删除守护进程&面板配置自动保存
|
||||
cronset "clash保守模式守护进程"
|
||||
|
@ -1154,8 +1154,6 @@ restart)
|
|||
$0 start
|
||||
;;
|
||||
init)
|
||||
sleep 30
|
||||
logger ShellClash正在开机初始化!
|
||||
if [ -d "/etc/storage/clash" ];then
|
||||
clashdir=/etc/storage/clash
|
||||
i=1
|
||||
|
@ -1165,7 +1163,7 @@ init)
|
|||
profile=/etc/profile
|
||||
sed -i '' $profile #将软链接转化为一般文件
|
||||
elif [ -d "/jffs" ];then
|
||||
sleep 30
|
||||
sleep 40
|
||||
clashdir=$(cd $(dirname $0);pwd)
|
||||
if [ -w /etc/profile ];then
|
||||
profile=/etc/profile
|
||||
|
@ -1185,14 +1183,14 @@ init)
|
|||
getyaml)
|
||||
getconfig
|
||||
getyaml && \
|
||||
logger 配置文件更新成功!
|
||||
logger ShellClash配置文件更新成功!
|
||||
;;
|
||||
updateyaml)
|
||||
getconfig
|
||||
getyaml && \
|
||||
modify_yaml && \
|
||||
put_save http://localhost:${db_port}/configs "{\"path\":\"${clashdir}/config.yaml\"}" && \
|
||||
logger 配置文件更新成功!
|
||||
logger ShellClash配置文件更新成功!
|
||||
;;
|
||||
logger)
|
||||
logger $2 $3
|
||||
|
|
Loading…
Reference in New Issue
Block a user