~默认更新服务器改成cloudflare源
~修复部分设备本地更新内核和配置文件报错的bug ~将默认路由表改成166避免冲突
This commit is contained in:
10
README_CN.md
10
README_CN.md
@@ -55,13 +55,11 @@
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo -i #切换到root用户,如果需要密码,请输入密码
|
sudo -i #切换到root用户,如果需要密码,请输入密码
|
||||||
bash #如已处于bash环境可跳过
|
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && bash /tmp/install.sh && source /etc/profile &> /dev/null
|
||||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && bash /tmp/install.sh && source /etc/profile &> /dev/null
|
|
||||||
```
|
```
|
||||||
或者
|
或者
|
||||||
```shell
|
```shell
|
||||||
sudo -i #切换到root用户,如果需要密码,请输入密码
|
sudo -i #切换到root用户,如果需要密码,请输入密码
|
||||||
bash #如已处于bash环境可跳过
|
|
||||||
export url='https://gh.jwsc.eu.org/master' && bash -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
export url='https://gh.jwsc.eu.org/master' && bash -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -74,7 +72,7 @@ export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' && sh -c
|
|||||||
或者
|
或者
|
||||||
```shell
|
```shell
|
||||||
#jsDelivrCDN源
|
#jsDelivrCDN源
|
||||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||||
```
|
```
|
||||||
或者
|
或者
|
||||||
```shell
|
```shell
|
||||||
@@ -91,7 +89,7 @@ export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' && wget
|
|||||||
或者
|
或者
|
||||||
```shell
|
```shell
|
||||||
#jsDelivrCDN源
|
#jsDelivrCDN源
|
||||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||||
```
|
```
|
||||||
|
|
||||||
~**老旧设备使用低版本wge安装**:<br>
|
~**老旧设备使用低版本wge安装**:<br>
|
||||||
@@ -117,7 +115,7 @@ docker exec -it ShellCrash sh
|
|||||||
apk add curl
|
apk add curl
|
||||||
apk add nftables
|
apk add nftables
|
||||||
#执行安装命令
|
#执行安装命令
|
||||||
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
export url='https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -116,17 +116,16 @@ ckstatus() {
|
|||||||
[ ! -x ${CRASHDIR}/start.sh ] && chmod +x ${CRASHDIR}/start.sh
|
[ ! -x ${CRASHDIR}/start.sh ] && chmod +x ${CRASHDIR}/start.sh
|
||||||
#检查/tmp内核文件
|
#检查/tmp内核文件
|
||||||
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(gz|zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box|^clash.meta.*'); do
|
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(gz|zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box|^clash.meta.*'); do
|
||||||
file=/tmp/$file
|
chmod +x /tmp/$file
|
||||||
chmod +x $file
|
echo -e "发现可用的内核文件: \033[36m/tmp/$file\033[0m "
|
||||||
echo -e "发现可用的内核文件: \033[36m$file\033[0m "
|
|
||||||
read -p "是否加载(会停止当前服务)?(1/0) > " res
|
read -p "是否加载(会停止当前服务)?(1/0) > " res
|
||||||
[ "$res" = 1 ] && {
|
[ "$res" = 1 ] && {
|
||||||
${CRASHDIR}/start.sh stop
|
${CRASHDIR}/start.sh stop
|
||||||
core_v=$($file -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')
|
core_v=$(/tmp/$file -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')
|
||||||
[ -z "$core_v" ] && core_v=$($file version 2>/dev/null | grep -Eo 'version .*' | sed 's/version //')
|
[ -z "$core_v" ] && core_v=$(/tmp/$file version 2>/dev/null | grep -Eo 'version .*' | sed 's/version //')
|
||||||
if [ -n "$core_v" ]; then
|
if [ -n "$core_v" ]; then
|
||||||
source ${CRASHDIR}/webget.sh && setcoretype &&
|
source ${CRASHDIR}/webget.sh && setcoretype &&
|
||||||
mv -f $file ${TMPDIR}/CrashCore &&
|
mv -f /tmp/$file ${TMPDIR}/CrashCore &&
|
||||||
tar -zcf ${BINDIR}/CrashCore.tar.gz ${tar_para} -C ${TMPDIR} CrashCore &&
|
tar -zcf ${BINDIR}/CrashCore.tar.gz ${tar_para} -C ${TMPDIR} CrashCore &&
|
||||||
echo -e "\033[32m内核加载完成!\033[0m " &&
|
echo -e "\033[32m内核加载完成!\033[0m " &&
|
||||||
setconfig crashcore $crashcore &&
|
setconfig crashcore $crashcore &&
|
||||||
@@ -135,7 +134,7 @@ ckstatus() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
else
|
else
|
||||||
echo -e "\033[33m检测到不可用的内核文件!可能是文件受损或CPU架构不匹配!\033[0m"
|
echo -e "\033[33m检测到不可用的内核文件!可能是文件受损或CPU架构不匹配!\033[0m"
|
||||||
rm -rf $file
|
rm -rf /tmp/$file
|
||||||
echo -e "\033[33m内核文件已移除,请认真检查后重新上传!\033[0m"
|
echo -e "\033[33m内核文件已移除,请认真检查后重新上传!\033[0m"
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
@@ -144,14 +143,14 @@ ckstatus() {
|
|||||||
done
|
done
|
||||||
#检查/tmp配置文件
|
#检查/tmp配置文件
|
||||||
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -iE '.yaml$|.yml$|config.json$'); do
|
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -iE '.yaml$|.yml$|config.json$'); do
|
||||||
file=/tmp/$file
|
tmp_file=/tmp/$file
|
||||||
echo -e "发现内核配置文件: \033[36m$file\033[0m "
|
echo -e "发现内核配置文件: \033[36m/tmp/$file\033[0m "
|
||||||
read -p "是否加载为$crashcore的配置文件?(1/0) > " res
|
read -p "是否加载为$crashcore的配置文件?(1/0) > " res
|
||||||
[ "$res" = 1 ] && {
|
[ "$res" = 1 ] && {
|
||||||
if [ -n "$(echo $file | grep -iE '.json$')" ]; then
|
if [ -n "$(echo /tmp/$file | grep -iE '.json$')" ]; then
|
||||||
mv -f $file ${CRASHDIR}/jsons/config.json
|
mv -f /tmp/$file ${CRASHDIR}/jsons/config.json
|
||||||
else
|
else
|
||||||
mv -f $file ${CRASHDIR}/yamls/config.yaml
|
mv -f /tmp/$file ${CRASHDIR}/yamls/config.yaml
|
||||||
fi
|
fi
|
||||||
echo -e "\033[32m配置文件加载完成!\033[0m "
|
echo -e "\033[32m配置文件加载完成!\033[0m "
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|||||||
@@ -1425,7 +1425,7 @@ start_firewall() { #路由规则总入口
|
|||||||
getlanip #获取局域网host地址
|
getlanip #获取局域网host地址
|
||||||
#设置策略路由
|
#设置策略路由
|
||||||
[ "$firewall_area" != 4 ] && {
|
[ "$firewall_area" != 4 ] && {
|
||||||
local table=100
|
local table=166
|
||||||
[ "$redir_mod" = "Tproxy模式" ] && ip route add local default dev lo table $table 2>/dev/null
|
[ "$redir_mod" = "Tproxy模式" ] && ip route add local default dev lo table $table 2>/dev/null
|
||||||
[ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && {
|
[ "$redir_mod" = "Tun模式" -o "$redir_mod" = "混合模式" ] && {
|
||||||
i=1
|
i=1
|
||||||
|
|||||||
Reference in New Issue
Block a user