mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 11:42:18 +08:00
~为华硕设备添加基于下载大师的自启选项
~增加对mix、redir、tproxy端口为目标流量的拦截机制以防止回环 ~增加对华硕设备切换使用meta内核的警告信息
This commit is contained in:
parent
e203938ca6
commit
047297ba2a
|
@ -132,8 +132,8 @@ if [ -n "$systype" ];then
|
|||
[ "$systype" = "asusrouter" ] && {
|
||||
$echo "\033[33m检测到当前设备为华硕固件,请选择安装方式\033[0m"
|
||||
$echo " 1 基于USB设备安装(限23年9月之前固件,须插入\033[31m任意\033[0mUSB设备)"
|
||||
$echo " 2 基于自启脚本安装(仅支持梅林及部分官改固件)"
|
||||
$echo " 3 基于下载大师安装(支持最新固件,限ARM设备,须插入U盘或移动硬盘)"
|
||||
$echo " 2 基于自启脚本安装(仅支持梅林及部分非koolshare官改固件)"
|
||||
$echo " 3 基于U盘+下载大师安装(支持所有固件,限ARM设备,须插入U盘或移动硬盘)"
|
||||
$echo " 0 退出安装"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入相应数字 > " num
|
||||
|
@ -149,7 +149,7 @@ if [ -n "$systype" ];then
|
|||
dir=/jffs
|
||||
;;
|
||||
3)
|
||||
echo -e "请先在路由器网页后台安装下载大师,之后选择外置存储所在目录!"
|
||||
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
|
||||
sleep 2
|
||||
set_asus_dir
|
||||
;;
|
||||
|
|
|
@ -66,8 +66,8 @@ if [ -n "$systype" ];then
|
|||
[ "$systype" = "asusrouter" ] && {
|
||||
echo -e "\033[33m检测到当前设备为华硕固件,请选择安装方式\033[0m"
|
||||
echo -e " 1 基于USB设备安装(限23年9月之前固件,须插入\033[31m任意\033[0mUSB设备)"
|
||||
echo -e " 2 基于自启脚本安装(仅支持梅林及部分官改固件)"
|
||||
echo -e " 3 基于下载大师安装(支持最新固件,限ARM设备,须插入U盘或移动硬盘)"
|
||||
echo -e " 2 基于自启脚本安装(仅支持梅林及部分非koolshare官改固件)"
|
||||
echo -e " 3 基于U盘+下载大师安装(支持所有固件,限ARM设备,须插入U盘或移动硬盘)"
|
||||
echo -e " 0 退出安装"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入相应数字 > " num
|
||||
|
@ -83,7 +83,7 @@ if [ -n "$systype" ];then
|
|||
dir=/jffs
|
||||
;;
|
||||
3)
|
||||
echo -e "请先在路由器网页后台安装下载大师,之后选择外置存储所在目录!"
|
||||
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
|
||||
sleep 2
|
||||
set_asus_dir
|
||||
;;
|
||||
|
@ -226,7 +226,7 @@ setconfig COMMAND "$COMMAND" ${CRASHDIR}/configs/command.env
|
|||
#设置防火墙执行模式
|
||||
grep -q 'firewall_mod' "$CRASHDIR/configs/ShellClash.cfg" 2>/dev/null || {
|
||||
iptables -j REDIRECT -h >/dev/null 2>&1 && firewall_mod=iptables
|
||||
nft add table inet test4532 2>/dev/null && firewall_mod=nftables && nft delete table inet test4532
|
||||
nft add table inet shellcrash 2>/dev/null && firewall_mod=nftables
|
||||
setconfig firewall_mod $firewall_mod
|
||||
}
|
||||
#设置更新地址
|
||||
|
@ -298,7 +298,7 @@ fi
|
|||
nvram commit
|
||||
}
|
||||
#华硕下载大师启动额外设置
|
||||
[ -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ] && \
|
||||
[ -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ] && [ -z "$(grep 'ShellCrash' $dir/asusware.arm/etc/init.d/S50downloadmaster)" ] && \
|
||||
sed -i "/^PATH=/a\\$CRASHDIR/start.sh init #ShellCrash初始化脚本" "$dir/asusware.arm/etc/init.d/S50downloadmaster"
|
||||
#删除临时文件
|
||||
rm -rf /tmp/*rash*gz
|
||||
|
|
|
@ -916,6 +916,7 @@ start_ipt_route() { #iptables-route通用工具
|
|||
$1 $w -t $2 -A $4 -m owner --gid-owner $gid -j RETURN
|
||||
done
|
||||
[ "$firewall_area" = 5 ] && $1 $w -t $2 -A $4 -s $bypass_host -j RETURN
|
||||
[ -z "$ports" ] && $1 $w -t $2 -A $4 -m multiport --dports "$mix_port,$redir_port,$tproxy_port" -j RETURN
|
||||
#跳过目标保留地址及目标本机网段
|
||||
for ip in $HOST_IP $RESERVED_IP; do
|
||||
$1 $w -t $2 -A $4 -d $ip -j RETURN
|
||||
|
@ -1180,6 +1181,7 @@ start_nft_route() { #nftables-route通用工具
|
|||
#防回环
|
||||
nft add rule inet shellcrash $1 meta mark $routing_mark return
|
||||
nft add rule inet shellcrash $1 meta skgid 7890 return
|
||||
[ -z "$ports" ] && nft add rule inet shellcrash $1 tcp dport {"$mix_port, $redir_port, $tproxy_port"} return
|
||||
#nft add rule inet shellcrash $1 ip saddr 198.18.0.0/16 return
|
||||
[ "$firewall_area" = 5 ] && nft add rule inet shellcrash $1 ip saddr $bypass_host return
|
||||
nft add rule inet shellcrash $1 ip daddr {$RESERVED_IP} return #过滤保留地址
|
||||
|
|
|
@ -1480,7 +1480,7 @@ setcore(){ #内核选择菜单
|
|||
echo -e " >>\033[32m$singbox_v \033[33m不支持providers\033[0m"
|
||||
echo -e " 说明文档: \033[36;4mhttps://sing-box.sagernet.org\033[0m"
|
||||
echo -e "3 \033[43;30m Meta \033[0m: \033[32m多功能,支持全面\033[0m"
|
||||
echo -e " >>\033[32m$meta_v \033[33m内存占用较高\033[0m"
|
||||
echo -e " >>\033[32m$meta_v \033[33m占用略高,GeoSite可能不兼容华硕固件\033[0m"
|
||||
echo -e " 说明文档: \033[36;4mhttps://wiki.metacubex.one\033[0m"
|
||||
echo -e "4 \033[43;30m SingBoxP \033[0m: \033[32m支持ssr、providers、dns并发……\033[0m"
|
||||
echo -e " >>\033[32m$singboxp_v \033[33mPuerNya分支版本\033[0m"
|
||||
|
@ -1506,6 +1506,10 @@ setcore(){ #内核选择菜单
|
|||
getcore
|
||||
;;
|
||||
3)
|
||||
[ -d "/jffs" ] && {
|
||||
echo -e "\033[31mMeta内核使用的GeoSite.dat数据库在华硕设备存在被系统误删的问题,可能无法使用!\033[0m"
|
||||
sleep 3
|
||||
}
|
||||
crashcore=meta
|
||||
custcorelink=''
|
||||
getcore
|
||||
|
|
Loading…
Reference in New Issue
Block a user