diff --git a/PATCH/app/ShellClash.sh b/PATCH/app/ShellClash.sh deleted file mode 100755 index ca2b64e..0000000 --- a/PATCH/app/ShellClash.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -echo 'ShellClash' - -pushd package/base-files/files - mkdir -p etc/clash - mkdir -p etc/init.d - shellclash_version=$(curl -sL https://raw.githubusercontent.com/RikudouPatrickstar/ShellClash/master/bin/version | grep "versionsh" | awk -F "=" '{print $2}') - pushd etc/clash - # 创建ShellClash相关目录 - mkdir -p configs tools ui yamls - ## 脚本及 Clash Meta Core - wget https://raw.githubusercontent.com/RikudouPatrickstar/ShellClash/master/bin/clashfm.tar.gz -O - | tar xz -C ./ - wget https://raw.githubusercontent.com/RikudouPatrickstar/ShellClash/master/bin/clash.meta/clash-linux-armv8 -O clash - chmod 755 * - ## 设置系统服务 - mv clashservice ../init.d/clash - ## 地址库 - wget https://raw.githubusercontent.com/RikudouPatrickstar/GeoIP2-CN/release/Country.mmdb -O Country.mmdb - ## 控制面板 - wget https://raw.githubusercontent.com/RikudouPatrickstar/ShellClash/master/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 - pushd configs - ## 放置各list文件 - mv ../*.list ./ - ## 初始化ShellClash.cfg - echo "versionsh_l=${shellclash_version}" >> ShellClash.cfg - echo "update_url=https://raw.githubusercontent.com/RikudouPatrickstar/ShellClash/master" >> ShellClash.cfg - echo "userguide=1" >> ShellClash.cfg - echo "redir_mod=Nft混合" >> ShellClash.cfg - echo "clashcore=clash.meta" >> ShellClash.cfg - echo "cpucore=armv8" >> ShellClash.cfg - echo "hostdir=':9999/ui'" >> ShellClash.cfg - echo "geotype=cn_mini.mmdb" >> ShellClash.cfg - echo "Geo_v=$(date +'%Y%m%d')" >> ShellClash.cfg - echo "ipv6_support=未开启" >> ShellClash.cfg - echo "ipv6_dns=未开启" >> ShellClash.cfg - echo "local_proxy=已开启" >> ShellClash.cfg - echo "local_type=nftables增强模式" >> ShellClash.cfg - echo "web_save_cron=已关闭" >> ShellClash.cfg - chmod 644 * - popd - ## 清理多余文件 - rm -fr clash.service misnap_init.sh - popd - ## 设置环境变量 - echo 'alias clash="sh /etc/clash/clash.sh"' >> etc/profile - echo 'export clashdir="/etc/clash"' >> etc/profile -popd - -exit 0 diff --git a/PATCH/app/ShellCrash.sh b/PATCH/app/ShellCrash.sh new file mode 100644 index 0000000..7923b83 --- /dev/null +++ b/PATCH/app/ShellCrash.sh @@ -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 diff --git a/PATCH/zzz-default-settings b/PATCH/zzz-default-settings index 2dac406..0aadae1 100755 --- a/PATCH/zzz-default-settings +++ b/PATCH/zzz-default-settings @@ -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' diff --git a/README.md b/README.md index 2a7ff42..2e9b293 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/SCRIPTS/my_prepare_package.sh b/SCRIPTS/my_prepare_package.sh index 259004f..3c68627 100755 --- a/SCRIPTS/my_prepare_package.sh +++ b/SCRIPTS/my_prepare_package.sh @@ -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