mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-12 16:31:25 +00:00
Merge branch 'dev' into gateway
# Conflicts: # scripts/start.sh
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
meta_v=v1.19.17
|
meta_v=v1.19.17
|
||||||
singboxr_v=1.13.0-alpha.27
|
singboxr_v=1.13.0-alpha.27
|
||||||
versionsh=1.9.3beta7fix
|
versionsh=1.9.3beta8
|
||||||
GeoIP_v=20251205
|
GeoIP_v=20251205
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (C) Juewuy
|
# Copyright (C) Juewuy
|
||||||
|
|
||||||
version=1.9.3beta7fix
|
version=1.9.3beta8
|
||||||
|
|
||||||
setdir() {
|
setdir() {
|
||||||
dir_avail() {
|
dir_avail() {
|
||||||
@@ -159,12 +159,12 @@ setconfig() { #脚本配置工具
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
#特殊固件识别及标记
|
#特殊固件识别及标记
|
||||||
[ -f "/etc/storage/started_script.sh" ] && {
|
[ -f "/etc/storage/started_script.sh" ] && { #老毛子固件
|
||||||
systype=Padavan #老毛子固件
|
systype=Padavan
|
||||||
initdir='/etc/storage/started_script.sh'
|
initdir='/etc/storage/started_script.sh'
|
||||||
}
|
}
|
||||||
[ -d "/jffs" ] && {
|
[ -d "/jffs" ] && { #华硕固件
|
||||||
systype=asusrouter #华硕固件
|
systype=asusrouter
|
||||||
[ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter'
|
[ -f "/jffs/.asusrouter" ] && initdir='/jffs/.asusrouter'
|
||||||
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
|
[ -d "/jffs/scripts" ] && initdir='/jffs/scripts/nat-start'
|
||||||
#华硕启用jffs
|
#华硕启用jffs
|
||||||
@@ -173,7 +173,8 @@ setconfig() { #脚本配置工具
|
|||||||
}
|
}
|
||||||
[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot #小米设备
|
[ -f "/data/etc/crontabs/root" ] && systype=mi_snapshot #小米设备
|
||||||
[ -w "/var/mnt/cfg/firewall" ] && systype=ng_snapshot #NETGEAR设备
|
[ -w "/var/mnt/cfg/firewall" ] && systype=ng_snapshot #NETGEAR设备
|
||||||
|
#容器内环境
|
||||||
|
grep -qE '/(docker|lxc|kubepods|crio|containerd)/' /proc/1/cgroup || [ -f /run/.containerenv ] || [ -f /.dockerenv ] && systype=container
|
||||||
#检查环境变量
|
#检查环境变量
|
||||||
[ -z "$CRASHDIR" -a -n "$clashdir" ] && CRASHDIR=$clashdir
|
[ -z "$CRASHDIR" -a -n "$clashdir" ] && CRASHDIR=$clashdir
|
||||||
[ -z "$CRASHDIR" -a -d /tmp/SC_tmp ] && setdir
|
[ -z "$CRASHDIR" -a -d /tmp/SC_tmp ] && setdir
|
||||||
@@ -290,7 +291,6 @@ if [ "$systype" = "mi_snapshot" -o "$systype" = "ng_snapshot" ]; then
|
|||||||
uci set firewall.ShellCrash.path="$CRASHDIR/misnap_init.sh"
|
uci set firewall.ShellCrash.path="$CRASHDIR/misnap_init.sh"
|
||||||
uci set firewall.ShellCrash.enabled='1'
|
uci set firewall.ShellCrash.enabled='1'
|
||||||
uci commit firewall
|
uci commit firewall
|
||||||
setconfig systype $systype
|
|
||||||
else
|
else
|
||||||
rm -rf ${CRASHDIR}/misnap_init.sh
|
rm -rf ${CRASHDIR}/misnap_init.sh
|
||||||
fi
|
fi
|
||||||
@@ -303,6 +303,18 @@ fi
|
|||||||
#华硕下载大师启动额外设置
|
#华硕下载大师启动额外设置
|
||||||
[ -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ] && [ -z "$(grep 'ShellCrash' $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"
|
sed -i "/^PATH=/a\\$CRASHDIR/start.sh init & #ShellCrash初始化脚本" "$dir/asusware.arm/etc/init.d/S50downloadmaster"
|
||||||
|
#容器环境额外设置
|
||||||
|
[ "$systype" = 'container' ] && {
|
||||||
|
setconfig userguide '1'
|
||||||
|
setconfig crashcore 'meta'
|
||||||
|
setconfig redir_mod "混合模式"
|
||||||
|
setconfig dns_mod 'mix'
|
||||||
|
setconfig firewall_area '1'
|
||||||
|
setconfig firewall_mod 'nftables'
|
||||||
|
setconfig start_old '已开启'
|
||||||
|
echo "$CRASHDIR/menu.sh" >> /etc/profile
|
||||||
|
}
|
||||||
|
setconfig systype $systype
|
||||||
#删除临时文件
|
#删除临时文件
|
||||||
rm -rf /tmp/*rash*gz
|
rm -rf /tmp/*rash*gz
|
||||||
rm -rf /tmp/SC_tmp
|
rm -rf /tmp/SC_tmp
|
||||||
@@ -360,7 +372,4 @@ sed -i "s/redir_mod=Nft混合/redir_mod=Tproxy模式/g" $configpath
|
|||||||
sed -i "s/redir_mod=Tproxy混合/redir_mod=Tproxy模式/g" $configpath
|
sed -i "s/redir_mod=Tproxy混合/redir_mod=Tproxy模式/g" $configpath
|
||||||
sed -i "s/redir_mod=纯净模式/firewall_area=4/g" $configpath
|
sed -i "s/redir_mod=纯净模式/firewall_area=4/g" $configpath
|
||||||
|
|
||||||
#清理路由器空间
|
|
||||||
[ -d /data/etc_bak ] && rm -rf /data/etc_bak
|
|
||||||
|
|
||||||
echo -e "\033[32m脚本初始化完成,请输入\033[30;47m crash \033[0;33m命令开始使用!\033[0m"
|
echo -e "\033[32m脚本初始化完成,请输入\033[30;47m crash \033[0;33m命令开始使用!\033[0m"
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ setport() { #端口设置
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
setdns() { #DNS详细设置
|
setdns() { #DNS详细设置
|
||||||
[ -z "$dns_nameserver" ] && dns_nameserver='180.184.1.1, 1.2.4.8'
|
[ -z "$dns_nameserver" ] && dns_nameserver='223.5.5.5, 1.2.4.8'
|
||||||
[ -z "$dns_fallback" ] && dns_fallback="1.1.1.1, 8.8.8.8"
|
[ -z "$dns_fallback" ] && dns_fallback="1.1.1.1, 8.8.8.8"
|
||||||
[ -z "$dns_resolver" ] && dns_resolver="223.5.5.5, 2400:3200::1"
|
[ -z "$dns_resolver" ] && dns_resolver="223.5.5.5, 2400:3200::1"
|
||||||
[ -z "$hosts_opt" ] && hosts_opt=已启用
|
[ -z "$hosts_opt" ] && hosts_opt=已启用
|
||||||
@@ -811,7 +811,7 @@ setdns() { #DNS详细设置
|
|||||||
openssldir="$(openssl version -d 2>&1 | awk -F '"' '{print $2}')"
|
openssldir="$(openssl version -d 2>&1 | awk -F '"' '{print $2}')"
|
||||||
if [ -s "$openssldir/certs/ca-certificates.crt" ] || [ -s "/etc/ssl/certs/ca-certificates.crt" ] ||
|
if [ -s "$openssldir/certs/ca-certificates.crt" ] || [ -s "/etc/ssl/certs/ca-certificates.crt" ] ||
|
||||||
echo "$crashcore" | grep -qE 'meta|singbox'; then
|
echo "$crashcore" | grep -qE 'meta|singbox'; then
|
||||||
dns_nameserver='https://doh.360.cn/dns-query, https://dns.alidns.com/dns-query, https://doh.pub/dns-query'
|
dns_nameserver='https://dns.alidns.com/dns-query, https://doh.pub/dns-query'
|
||||||
dns_fallback='https://cloudflare-dns.com/dns-query, https://dns.google/dns-query, https://doh.opendns.com/dns-query'
|
dns_fallback='https://cloudflare-dns.com/dns-query, https://dns.google/dns-query, https://doh.opendns.com/dns-query'
|
||||||
dns_resolver='https://223.5.5.5/dns-query, 2400:3200::1'
|
dns_resolver='https://223.5.5.5/dns-query, 2400:3200::1'
|
||||||
setconfig dns_nameserver "'$dns_nameserver'"
|
setconfig dns_nameserver "'$dns_nameserver'"
|
||||||
|
|||||||
3611
scripts/start.sh
3611
scripts/start.sh
File diff suppressed because it is too large
Load Diff
@@ -452,7 +452,7 @@ EOF
|
|||||||
"url": "${2}",
|
"url": "${2}",
|
||||||
"path": "./providers/${1}.yaml",
|
"path": "./providers/${1}.yaml",
|
||||||
"user_agent": "clash.meta;mihomo",
|
"user_agent": "clash.meta;mihomo",
|
||||||
"update_interval": "24h",
|
"update_interval": "12h",
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
#通用部分生成
|
#通用部分生成
|
||||||
@@ -2352,7 +2352,7 @@ userguide(){
|
|||||||
fi
|
fi
|
||||||
#设置加密DNS
|
#设置加密DNS
|
||||||
if [ -s $openssldir/certs/ca-certificates.crt ];then
|
if [ -s $openssldir/certs/ca-certificates.crt ];then
|
||||||
dns_nameserver='https://doh.360.cn/dns-query, https://dns.alidns.com/dns-query, https://doh.pub/dns-query'
|
dns_nameserver='https://dns.alidns.com/dns-query, https://doh.pub/dns-query'
|
||||||
dns_fallback='https://cloudflare-dns.com/dns-query, https://dns.google/dns-query, https://doh.opendns.com/dns-query'
|
dns_fallback='https://cloudflare-dns.com/dns-query, https://dns.google/dns-query, https://doh.opendns.com/dns-query'
|
||||||
dns_resolver='https://223.5.5.5/dns-query, 2400:3200::1'
|
dns_resolver='https://223.5.5.5/dns-query, 2400:3200::1'
|
||||||
setconfig dns_nameserver "'$dns_nameserver'"
|
setconfig dns_nameserver "'$dns_nameserver'"
|
||||||
|
|||||||
Reference in New Issue
Block a user