Skip to content

Commit

Permalink
更新 ShellCrash
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouPatrickstar committed Jul 27, 2024
1 parent 233c883 commit 9561a20
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 56 deletions.
52 changes: 0 additions & 52 deletions PATCH/app/ShellClash.sh

This file was deleted.

68 changes: 68 additions & 0 deletions PATCH/app/ShellCrash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

echo 'ShellCrash'

pushd package/base-files/files
mkdir -p etc/ShellCrash
mkdir -p etc/init.d
crash_version=$(curl -sL https://raw.githubusercontent.com/RikudouPatrickstar/ShellCrash/dev/bin/version | grep "versionsh" | awk -F "=" '{print $2}')
core_version=$(curl -sL https://raw.githubusercontent.com/RikudouPatrickstar/ShellCrash/dev/bin/version | grep "meta_v" | awk -F "=" '{print $2}')
pushd etc/ShellCrash
# 下载安装文件
wget https://raw.githubusercontent.com/RikudouPatrickstar/ShellCrash/dev/bin/clashfm.tar.gz -O - | tar xz -C ./
# 创建ShellCrash相关目录
mkdir -p configs jsons task tools ui yamls
pushd task
mv ../task.* ./
popd
pushd configs
mv ../*.list ./
# 初始化command.env
echo "TMPDIR=/tmp/ShellCrash" >> command.env
echo "BINDIR=/etc/ShellCrash" >> command.env
echo 'COMMAND="$TMPDIR/CrashCore -d $BINDIR -f $TMPDIR/config.yaml"' >> command.env
# 初始化ShellCrash.cfg
echo "versionsh_l=${crash_version}" >> ShellCrash.cfg
echo "firewall_mod=nftables" >> ShellCrash.cfg
echo "update_url=https://raw.githubusercontent.com/RikudouPatrickstar/ShellCrash/dev" >> ShellCrash.cfg
echo "userguide=1" >> ShellCrash.cfg
echo "redir_mod=Tproxy模式" >> ShellCrash.cfg
echo "dns_mod=redir_host" >> ShellCrash.cfg
echo "dns_nameserver='https://223.5.5.5/dns-query, https://doh.pub/dns-query, tls://dns.rubyfish.cn:853'" >> ShellCrash.cfg
echo "dns_fallback='https://1.0.0.1/dns-query, https://8.8.4.4/dns-query, https://doh.opendns.com/dns-query'" >> ShellCrash.cfg
echo "cpucore=arm64" >> ShellCrash.cfg
echo "crashcore=meta" >> ShellCrash.cfg
echo "core_v=${core_version}" >> ShellCrash.cfg
echo "cn_mini_v=$(date +'%Y%m%d')" >> ShellCrash.cfg
echo "hostdir=':9999/ui'" >> ShellCrash.cfg
echo "ipv6_support=未开启" >> ShellCrash.cfg
echo "ipv6_dns=未开启" >> ShellCrash.cfg
echo "ipv6_redir=未开启" >> ShellCrash.cfg
echo "firewall_area=3" >> ShellCrash.cfg
popd
# 设置系统服务
mv shellcrash.procd ../init.d/shellcrash
# 清理多余文件
rm -fr shellcrash.service misnap_init.sh

# 下载Meta内核
wget https://raw.githubusercontent.com/RikudouPatrickstar/ShellCrash/dev/bin/meta/clash-linux-arm64.tar.gz -O CrashCore.tar.gz
# 下载IP地址库
wget https://raw.githubusercontent.com/RikudouPatrickstar/GeoIP2-CN/release/Country.mmdb -O Country.mmdb
# 下载控制面板
wget https://raw.githubusercontent.com/RikudouPatrickstar/ShellCrash/dev/bin/dashboard/meta_xd.tar.gz -O - | tar xz -C ./ui
sed -i "s/127.0.0.1/192.168.24.1/g" ui/assets/*.js
sed -i "s/9090/9999/g" ui/assets/*.js

# 授予文件权限
chmod -R 644 *
find . -type d -exec chmod 755 {} \;
find . -type f -name '*.sh' -exec chmod 755 {} \;
popd
# 设置环境变量
echo 'alias crash="ash /etc/ShellCrash/menu.sh"' >> etc/profile
echo 'alias clash="ash /etc/ShellCrash/menu.sh"' >> etc/profile
echo 'export CRASHDIR="/etc/ShellCrash"' >> etc/profile
popd

exit 0
2 changes: 1 addition & 1 deletion PATCH/zzz-default-settings
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ echo "log-facility=/dev/null" >> /etc/dnsmasq.conf
# uci commit openclash

# ShellClash
/etc/init.d/clash disable
/etc/init.d/shellcrash disable

# Samba4
uci set samba4.@samba[0].interface='lan'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## 特性
- 默认 LAN IP: 192.168.24.1
- 插件清单:
- 应用:[Samba4](https://github.com/openwrt/luci/tree/openwrt-23.05/applications/luci-app-samba4)[ShellClash](https://github.com/juewuy/ShellClash)
- 应用:[Samba4](https://github.com/openwrt/luci/tree/openwrt-23.05/applications/luci-app-samba4)[ShellCrash](https://github.com/juewuy/ShellCrash)
- 主题:[Argon](https://github.com/jerrykuku/luci-theme-argon/tree/master)
- 移除上游[部分](https://github.com/RikudouPatrickstar/R2S-OpenWrt/blob/master/SCRIPTS/my_prepare_package.sh#L10)组件
- 继承自上游的[更多特性](https://github.com/nicholas-opensource/OpenWrt-Autobuild/tree/main#feature)
Expand Down
4 changes: 2 additions & 2 deletions SCRIPTS/my_prepare_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ sed -i 's/luci-theme-bootstrap/luci-theme-argon/' ./feeds/luci/collections/luci-
# Argon 主题
bash ${OP_SC_DIR}/../PATCH/app/Argon.sh

# ShellClash
bash ${OP_SC_DIR}/../PATCH/app/ShellClash.sh
# ShellCrash
bash ${OP_SC_DIR}/../PATCH/app/ShellCrash.sh

# frpc
# bash ${OP_SC_DIR}/../PATCH/app/frpc.sh
Expand Down

0 comments on commit 9561a20

Please sign in to comment.