Compare commits
115 Commits
singbox_co
...
singbox_co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
827f70a95b | ||
|
|
1a14d3f8e2 | ||
|
|
147c558e5f | ||
|
|
6d2edbdcd8 | ||
|
|
4cf7952f26 | ||
|
|
a921366d89 | ||
|
|
099fd89e6d | ||
|
|
1a621cb4a0 | ||
|
|
7f40ae54fc | ||
|
|
21aba94e04 | ||
|
|
bfccbb7e26 | ||
|
|
8bd3bf303d | ||
|
|
fa79806d77 | ||
|
|
395833f329 | ||
|
|
b1358563ee | ||
|
|
7d0310c263 | ||
|
|
973900c52e | ||
|
|
f242131387 | ||
|
|
3b7c61faef | ||
|
|
a7c1dbe68d | ||
|
|
ca43babe06 | ||
|
|
d985a821b9 | ||
|
|
8975e0bee5 | ||
|
|
85f01c987a | ||
|
|
7b48fbc84a | ||
|
|
5c8cfd7b71 | ||
|
|
85558022fa | ||
|
|
e3cd47c9f6 | ||
|
|
85240c1096 | ||
|
|
114b917983 | ||
|
|
bf9f013c61 | ||
|
|
daed770afd | ||
|
|
a8a9448d9e | ||
|
|
5013903d34 | ||
|
|
32dc9dc49a | ||
|
|
e28c47bc42 | ||
|
|
e176398e2a | ||
|
|
e815a1e7f5 | ||
|
|
1fbcc36bb8 | ||
|
|
b1f61ed0ab | ||
|
|
f5303961ca | ||
|
|
f114ba884d | ||
|
|
0e316335f3 | ||
|
|
9f0772b368 | ||
|
|
9f0a2f8e1a | ||
|
|
3cafe2b238 | ||
|
|
85547ab863 | ||
|
|
243c66282f | ||
|
|
b7c97ba007 | ||
|
|
cf9449f1f3 | ||
|
|
e5b198afe5 | ||
|
|
923b4ff596 | ||
|
|
a384fc6734 | ||
|
|
baa2dc1dd5 | ||
|
|
2090ead938 | ||
|
|
3ab931d946 | ||
|
|
54b7981833 | ||
|
|
705ed82396 | ||
|
|
8abdab8843 | ||
|
|
a83161fdf0 | ||
|
|
155ae9e9ea | ||
|
|
c1021a3459 | ||
|
|
0c8f4d7bb6 | ||
|
|
4640348c4d | ||
|
|
8b73700c9e | ||
|
|
997ec78ab8 | ||
|
|
a05bcd8238 | ||
|
|
e41e63cddb | ||
|
|
4bd9ee6d88 | ||
|
|
7759b0ed9a | ||
|
|
82a8c1cf6a | ||
|
|
bcf29a1bbb | ||
|
|
4cdd01e24e | ||
|
|
0e402881a1 | ||
|
|
ea1b44669d | ||
|
|
47a42b7a64 | ||
|
|
a01af085a7 | ||
|
|
75f1bbeaa4 | ||
|
|
3679267902 | ||
|
|
51dfb8feb7 | ||
|
|
3a8be13fa2 | ||
|
|
9863fc8a59 | ||
|
|
b42c7f5d14 | ||
|
|
2087bc8480 | ||
|
|
7dfd1a448e | ||
|
|
6d90b95530 | ||
|
|
a3edf7a4fd | ||
|
|
bf3debf51b | ||
|
|
d07edc66dc | ||
|
|
4f2309beb4 | ||
|
|
f9163f949b | ||
|
|
ff4fcf736b | ||
|
|
475b3b32e8 | ||
|
|
0ac216bf77 | ||
|
|
5d93ffe64f | ||
|
|
b5fe9b1acc | ||
|
|
ce907f5a6d | ||
|
|
b073c55d90 | ||
|
|
a3b88011bc | ||
|
|
0dfc146bb9 | ||
|
|
d37d0cb934 | ||
|
|
b38cdc91b5 | ||
|
|
3493ee3e5f | ||
|
|
a14e09c613 | ||
|
|
94b9c62691 | ||
|
|
2313647bd2 | ||
|
|
101bbae2ba | ||
|
|
2602a7842a | ||
|
|
485a31ff95 | ||
|
|
42a5474939 | ||
|
|
7fc1fa20d8 | ||
|
|
1f4deaa2e9 | ||
|
|
99a0c8494c | ||
|
|
809a5b224c | ||
|
|
e93af12812 |
10
.github/workflows/bin_update.yml
vendored
10
.github/workflows/bin_update.yml
vendored
@@ -20,9 +20,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Checkout ShellCrash
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
with:
|
||||
repository: juewuy/ShellCrash
|
||||
ref: dev
|
||||
- name: Apt Update
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
@@ -105,6 +107,8 @@ jobs:
|
||||
curl -kfSL -o geodata/china_ip_list.txt https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt
|
||||
curl -kfSL -o geodata/china_ipv6_list.txt https://raw.githubusercontent.com/ChanthMiao/China-IPv6-List/release/cn6.txt
|
||||
curl -kfSL -o geodata/geosite.dat https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geosite.dat
|
||||
curl -kfSL -o geodata/geoip_cn.db https://github.com/lyc8503/sing-box-rules/releases/latest/download/geoip-cn.db
|
||||
curl -kfSL -o geodata/geosite_cn.db https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite-cn.db
|
||||
curl -kfSL -o fix/ca-certificates.crt https://raw.githubusercontent.com/P3TERX/ca-certificates.crt/download/ca-certificates.crt
|
||||
sed -i '/GeoIP_v*/'d version
|
||||
echo GeoIP_v=`date '+%Y%m%d'` >> version
|
||||
|
||||
55
.github/workflows/update_clash_core.yaml
vendored
55
.github/workflows/update_clash_core.yaml
vendored
@@ -1,55 +0,0 @@
|
||||
name: Update Clash Core
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'version of Clash, such as v1.10.6'
|
||||
required: true
|
||||
type: string
|
||||
env:
|
||||
download_version: ${{ github.event.inputs.version }}
|
||||
download_url: https://github.com/Dreamacro/clash/releases/download
|
||||
jobs:
|
||||
Update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@main
|
||||
- name: Init Dependencies
|
||||
run: |
|
||||
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
|
||||
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
||||
tar xf upx-3.96-amd64_linux.tar.xz
|
||||
tar xf upx-3.93-amd64_linux.tar.xz
|
||||
- name: Download Core
|
||||
run: |
|
||||
archs="386 amd64 armv5 armv7 armv8 mips-softfloat mipsle-hardfloat mipsle-softfloat"
|
||||
mkdir tmp
|
||||
for arch in ${archs};do
|
||||
wget "${download_url}/${download_version}/clash-linux-${arch}-${download_version}.gz" -O - | gunzip -c > ./tmp/clash-linux-${arch}
|
||||
chmod +x ./tmp/clash-linux-${arch}
|
||||
if [ "${arch}" != "armv5" ];then
|
||||
if [[ ${arch} == mips* ]];then
|
||||
./upx-3.93-amd64_linux/upx ./tmp/clash-linux-${arch}
|
||||
else
|
||||
./upx-3.96-amd64_linux/upx ./tmp/clash-linux-${arch}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
rm -fr upx*
|
||||
- name: Update
|
||||
run: |
|
||||
rm -fr ./bin/clash/*
|
||||
cp ./tmp/* ./bin/clash/
|
||||
rm -fr ./tmp
|
||||
sed -i "s/clash_v=.*/clash_v=$(./bin/clash/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot"
|
||||
git add . && git commit -m "更新Clash内核至${download_version}" || exit 0
|
||||
git push
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
6
.github/workflows/update_meta_core.yaml
vendored
6
.github/workflows/update_meta_core.yaml
vendored
@@ -47,10 +47,10 @@ jobs:
|
||||
rm -fr upx*
|
||||
- name: Update
|
||||
run: |
|
||||
rm -fr ./bin/clash.meta/*
|
||||
cp ./tmp/* ./bin/clash.meta/
|
||||
rm -fr ./bin/meta/*
|
||||
cp ./tmp/* ./bin/meta/
|
||||
rm -fr ./tmp
|
||||
sed -i "s/meta_v=.*/meta_v=$(./bin/clash.meta/clash-linux-amd64 -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
sed -i "s/meta_v=.*/meta_v=$(./bin/meta/clash-linux-amd64 -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot"
|
||||
|
||||
179
.github/workflows/update_meta_core_test.yaml
vendored
Normal file
179
.github/workflows/update_meta_core_test.yaml
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
name: Test meta Core for ShellCrash
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag1:
|
||||
description: 'project name of meta, such as MetaCubeX/mihomo'
|
||||
required: true
|
||||
type: string
|
||||
tag2:
|
||||
description: 'tag or branches of meta, such as v1.18.0 or Alpha'
|
||||
required: true
|
||||
type: string
|
||||
tag3:
|
||||
description: 'a new prerelease name or not, if value=0, then only upload-artifact'
|
||||
required: false
|
||||
type: string
|
||||
tag4:
|
||||
description: 'build tags'
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
go:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{steps.go.outputs.version}}
|
||||
steps:
|
||||
- name: get latest go version
|
||||
id: go
|
||||
run: |
|
||||
echo version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||
|
||||
meta:
|
||||
runs-on: ubuntu-latest
|
||||
needs: go
|
||||
env:
|
||||
REPO: ${{ github.event.inputs.tag1 }}
|
||||
TAGS: ${{ github.event.inputs.tag4 }}
|
||||
outputs:
|
||||
version: ${{steps.meta.outputs.version}}
|
||||
tags: ${{steps.meta.outputs.tags}}
|
||||
steps:
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@v4.1.0
|
||||
with:
|
||||
go-version: ${{needs.go.outputs.version}}
|
||||
|
||||
- name: get meta version
|
||||
id: meta
|
||||
run: |
|
||||
version=${{ github.event.inputs.tag2 }}
|
||||
echo version=$version >> $GITHUB_OUTPUT
|
||||
if [ -z "$TAGS" ];then
|
||||
echo tags='' >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo tags=$TAGS >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
cross:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# linux
|
||||
- name: linux-amd64
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
goamd64: v1
|
||||
# - name: linux-386
|
||||
# goos: linux
|
||||
# goarch: 386
|
||||
# - name: linux-arm64
|
||||
# goos: linux
|
||||
# goarch: arm64
|
||||
# - name: linux-armv5
|
||||
# goos: linux
|
||||
# goarch: arm
|
||||
# goarm: 5
|
||||
# - name: linux-armv7
|
||||
# goos: linux
|
||||
# goarch: arm
|
||||
# goarm: 7
|
||||
# - name: linux-mips-softfloat
|
||||
# goos: linux
|
||||
# goarch: mips
|
||||
# gomips: softfloat
|
||||
# - name: linux-mipsel-softfloat
|
||||
# goos: linux
|
||||
# goarch: mipsle
|
||||
# gomips: softfloat
|
||||
# - name: linux-mipsel-hardfloat
|
||||
# goos: linux
|
||||
# goarch: mipsle
|
||||
# gomips: hardfloat
|
||||
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
needs: meta
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
GOAMD64: ${{ matrix.goamd64 }}
|
||||
GOARM: ${{ matrix.goarm }}
|
||||
GOMIPS: ${{ matrix.gomips }}
|
||||
CGO_ENABLED: 0
|
||||
TAGS: ${{needs.meta.outputs.tags}}
|
||||
VERSION: ${{needs.meta.outputs.version}}
|
||||
steps:
|
||||
- name: Checkout meta
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
with:
|
||||
repository: ${{ github.event.inputs.tag1 }}
|
||||
ref: ${{ github.event.inputs.tag2 }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ steps.go.outputs.version }}
|
||||
|
||||
- name: build core
|
||||
id: build
|
||||
run: go build -v -trimpath -ldflags "-X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" -o meta
|
||||
|
||||
- name: Upload file to workspace
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.name }}
|
||||
path: meta
|
||||
|
||||
push_prerelease:
|
||||
needs:
|
||||
- cross
|
||||
- meta
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RELEASE: ${{ github.event.inputs.tag3 }}
|
||||
VERSION: ${{needs.meta.outputs.version}}
|
||||
steps:
|
||||
- name: Download file from workspace
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./tmp
|
||||
|
||||
- name: Zip core by tar
|
||||
run: |
|
||||
for arch in amd64 ;do
|
||||
mv -f ./tmp/linux-${arch}/meta ./tmp/CrashCore
|
||||
chmod +x ./tmp/CrashCore
|
||||
tar --no-same-owner -zcvf ./tmp/meta-linux-${arch}.tar.gz -C ./tmp CrashCore
|
||||
done
|
||||
|
||||
- name: Create Release and Upload Release Asset
|
||||
if: ${{ env.RELEASE != '0' }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: meta_core${{ github.event.inputs.tag3 }}
|
||||
name: meta_core${{ github.event.inputs.tag3 }}
|
||||
body: "The ${{env.VERSION}} version of ${{ github.event.inputs.tag1 }} \n这是${{ github.event.inputs.tag1 }}的${{env.VERSION}}版本内核文件\nhttps://github.com/${{ github.event.inputs.tag1 }}/releases \nOnly support for ShellCrash\n仅适配ShellCrash项目使用"
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
./tmp/meta*
|
||||
|
||||
- name: upload artifact
|
||||
if: ${{ env.RELEASE == '0' }}
|
||||
uses: actions/upload-artifact@v4.1.0
|
||||
with:
|
||||
name: meta-${{env.VERSION}}-${{matrix.jobs.output}}
|
||||
path: |
|
||||
./tmp/meta*
|
||||
compression-level: 9
|
||||
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
@@ -1,53 +0,0 @@
|
||||
name: Update Premium latest Core
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 20 * * 6
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
download_version: latest
|
||||
download_url: https://release.dreamacro.workers.dev
|
||||
jobs:
|
||||
Update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@main
|
||||
- name: Init Dependencies
|
||||
run: |
|
||||
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
|
||||
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
||||
tar xf upx-3.96-amd64_linux.tar.xz
|
||||
tar xf upx-3.93-amd64_linux.tar.xz
|
||||
- name: Download Core
|
||||
run: |
|
||||
archs="386 amd64 armv5 armv7 arm64 mips-softfloat mipsle-hardfloat mipsle-softfloat"
|
||||
mkdir tmp
|
||||
for arch in ${archs};do
|
||||
wget "${download_url}/${download_version}/clash-linux-${arch}-${download_version}.gz" -O - | gunzip -c > ./tmp/clash-linux-${arch}
|
||||
chmod +x ./tmp/clash-linux-${arch}
|
||||
if [ "${arch}" != "armv5" ];then
|
||||
if [[ ${arch} == mips* ]];then
|
||||
./upx-3.93-amd64_linux/upx ./tmp/clash-linux-${arch}
|
||||
else
|
||||
./upx-3.96-amd64_linux/upx ./tmp/clash-linux-${arch}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv -f ./tmp/clash-linux-arm64 ./tmp/clash-linux-armv8
|
||||
rm -fr upx*
|
||||
- name: Create Release and Upload Release Asset
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: clash.premium.latest
|
||||
name: clash.premium.latest
|
||||
body: "The latest version of clash.premium core \n这是clash.premium的最新版本内核文件\nhttps://github.com/Dreamacro/clash/releases/tag/premium \nZip by upx\n使用了upx进行压缩\nOnly support for ShellClash\n仅限于ShellClash项目使用"
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
./tmp/*
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
56
.github/workflows/update_premium_core.yaml
vendored
56
.github/workflows/update_premium_core.yaml
vendored
@@ -1,56 +0,0 @@
|
||||
name: Update Premium Core
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'version of Clash Premium, such as 2022.05.18'
|
||||
required: true
|
||||
type: string
|
||||
env:
|
||||
download_version: ${{ github.event.inputs.version }}
|
||||
download_url: https://release.dreamacro.workers.dev
|
||||
jobs:
|
||||
Update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@main
|
||||
- name: Init Dependencies
|
||||
run: |
|
||||
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
|
||||
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
||||
tar xf upx-3.96-amd64_linux.tar.xz
|
||||
tar xf upx-3.93-amd64_linux.tar.xz
|
||||
- name: Download Core
|
||||
run: |
|
||||
archs="386 amd64 armv5 armv7 arm64 mips-softfloat mipsle-hardfloat mipsle-softfloat"
|
||||
mkdir tmp
|
||||
for arch in ${archs};do
|
||||
wget "${download_url}/${download_version}/clash-linux-${arch}-${download_version}.gz" -O - | gunzip -c > ./tmp/clash-linux-${arch}
|
||||
chmod +x ./tmp/clash-linux-${arch}
|
||||
if [ "${arch}" != "armv5" ];then
|
||||
if [[ ${arch} == mips* ]];then
|
||||
./upx-3.93-amd64_linux/upx ./tmp/clash-linux-${arch}
|
||||
else
|
||||
./upx-3.96-amd64_linux/upx ./tmp/clash-linux-${arch}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv -f ./tmp/clash-linux-arm64 ./tmp/clash-linux-armv8
|
||||
rm -fr upx*
|
||||
- name: Update
|
||||
run: |
|
||||
rm -fr ./bin/clashpre/*
|
||||
cp ./tmp/* ./bin/clashpre/
|
||||
rm -fr ./tmp
|
||||
sed -i "s/clashpre_v=.*/clashpre_v=$(./bin/clashpre/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot"
|
||||
git add . && git commit -m "更新Premium内核至${download_version}" || exit 0
|
||||
git push
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
181
.github/workflows/update_singbox_core.yaml
vendored
181
.github/workflows/update_singbox_core.yaml
vendored
@@ -1,55 +1,136 @@
|
||||
name: Update Sing-Box Core
|
||||
on:
|
||||
workflow_dispatch:
|
||||
name: Build Sing-Box Core for ShellCrash
|
||||
|
||||
env:
|
||||
download_project: SagerNet/sing-box
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'tag of sing-box, such as v1.7.8'
|
||||
required: true
|
||||
type: string
|
||||
jobs:
|
||||
Update:
|
||||
cross:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# linux
|
||||
- name: linux-amd64
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
goamd64: v1
|
||||
- name: linux-386
|
||||
goos: linux
|
||||
goarch: 386
|
||||
- name: linux-arm64
|
||||
goos: linux
|
||||
goarch: arm64
|
||||
- name: linux-armv5
|
||||
goos: linux
|
||||
goarch: arm
|
||||
goarm: 5
|
||||
- name: linux-armv7
|
||||
goos: linux
|
||||
goarch: arm
|
||||
goarm: 7
|
||||
- name: linux-mips-softfloat
|
||||
goos: linux
|
||||
goarch: mips
|
||||
gomips: softfloat
|
||||
- name: linux-mipsel-softfloat
|
||||
goos: linux
|
||||
goarch: mipsle
|
||||
gomips: softfloat
|
||||
- name: linux-mipsel-hardfloat
|
||||
goos: linux
|
||||
goarch: mipsle
|
||||
gomips: hardfloat
|
||||
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
GOAMD64: ${{ matrix.goamd64 }}
|
||||
GOARM: ${{ matrix.goarm }}
|
||||
GOMIPS: ${{ matrix.gomips }}
|
||||
CGO_ENABLED: 0
|
||||
TAGS: with_quic,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
|
||||
steps:
|
||||
- name: Checkout sing-box
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
with:
|
||||
repository: SagerNet/sing-box
|
||||
ref: ${{ github.event.inputs.tag }}
|
||||
fetch-depth: 0
|
||||
- name: Get latest go version
|
||||
id: version
|
||||
run: |
|
||||
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ steps.version.outputs.go_version }}
|
||||
- name: Build
|
||||
id: build
|
||||
run: make
|
||||
- name: Upload file to workspace
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.name }}
|
||||
path: sing-box
|
||||
push_ShellCrash:
|
||||
needs: cross
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@main
|
||||
- name: Init Dependencies
|
||||
run: |
|
||||
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
|
||||
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
||||
tar xf upx-3.96-amd64_linux.tar.xz
|
||||
tar xf upx-3.93-amd64_linux.tar.xz
|
||||
- name: Download Core
|
||||
run: |
|
||||
download_version=$(curl -s -L -o /dev/null -w '%{url_effective}' https://github.com/${download_project}/releases/latest | grep -oE "[^/]+$" | awk -F 'v' '{print $2}')
|
||||
echo "download_version=${download_version}" >> ${GITHUB_ENV}
|
||||
archs=(386 amd64 armv7 arm64)
|
||||
new_name=(386 amd64 armv7 armv8)
|
||||
mkdir tmp
|
||||
for((i=0;i<4;i++));do
|
||||
wget "https://github.com/${download_project}/releases/download/v${download_version}/sing-box-${download_version}-linux-${archs[i]}.tar.gz" -O ./tmp/core.tar.gz
|
||||
tar -zxvf ./tmp/core.tar.gz -C './tmp'
|
||||
mv -f ./tmp/sing-box-${download_version}-linux-${archs[i]}/sing-box ./tmp/singbox-linux-${new_name[i]}
|
||||
chmod +x ./tmp/singbox-linux-${new_name[i]}
|
||||
if [ "${archs[i]}" != "armv5" ];then
|
||||
if [[ ${archs[i]} = mips* ]];then
|
||||
./upx-3.93-amd64_linux/upx ./tmp/singbox-linux-${new_name[i]}
|
||||
else
|
||||
./upx-3.96-amd64_linux/upx ./tmp/singbox-linux-${new_name[i]}
|
||||
- name: Checkout ShellCrash
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
with:
|
||||
repository: juewuy/ShellCrash
|
||||
ref: dev
|
||||
- name: Get upx
|
||||
run: |
|
||||
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
|
||||
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
||||
tar xf upx-3.96-amd64_linux.tar.xz
|
||||
tar xf upx-3.93-amd64_linux.tar.xz
|
||||
- name: Download file from workspace
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./tmp
|
||||
- name: Zip core by upx
|
||||
run: |
|
||||
archs=(amd64 armv5 armv7 arm64 mips-softfloat mipsel-hardfloat mipsel-softfloat)
|
||||
new_name=(amd64 armv5 armv7 armv8 mips-softfloat mipsle-hardfloat mipsle-softfloat)
|
||||
for((i=0;i<7;i++));do
|
||||
mv -f ./tmp/linux-${archs[i]}/sing-box ./tmp/singbox-linux-${new_name[i]}
|
||||
chmod +x ./tmp/singbox-linux-${new_name[i]}
|
||||
if [ "${archs[i]}" != "armv5" ];then
|
||||
if [[ ${archs[i]} = mips* ]];then
|
||||
./upx-3.93-amd64_linux/upx ./tmp/singbox-linux-${new_name[i]}
|
||||
else
|
||||
./upx-3.96-amd64_linux/upx ./tmp/singbox-linux-${new_name[i]}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
rm -rf ./tmp/LICENSE
|
||||
rm -fr upx*
|
||||
- name: Create Release and Upload Release Asset
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: singbox_core
|
||||
name: singbox_core
|
||||
body: "The alpha version of singbox core \n这是singbox的官方版本内核文件\nhttps://github.com/${download_project}/releases \nZip by upx\n使用了upx进行压缩\nOnly support for ShellCrash\n仅限于ShellCrash项目使用"
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
./tmp/*
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
done
|
||||
rm -fr upx*
|
||||
- name: Update
|
||||
run: |
|
||||
mkdir -p ./bin/singbox
|
||||
rm -fr ./bin/singbox/*
|
||||
mv -f ./tmp/singbox-linux-* ./bin/singbox/
|
||||
rm -fr ./tmp
|
||||
sed -i "s/singbox_v=.*/singbox_v=$(./bin/singbox/singbox-linux-amd64 version 2>/dev/null | grep -Eo 'version .*' | sed 's/version //')/" bin/version
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot"
|
||||
git add . && git commit -m "更新sing-box内核至${{ github.event.inputs.tag }}" || exit 0
|
||||
git push
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sing-box-${{ matrix.name }}
|
||||
path: sing-box*
|
||||
|
||||
207
.github/workflows/update_singbox_core_test.yaml
vendored
Normal file
207
.github/workflows/update_singbox_core_test.yaml
vendored
Normal file
@@ -0,0 +1,207 @@
|
||||
name: Test Sing-Box Core for ShellCrash
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag1:
|
||||
description: 'project name of sing-box, such as SagerNet/sing-box'
|
||||
required: true
|
||||
type: string
|
||||
tag2:
|
||||
description: 'tag or branches of sing-box, such as v1.7.8 or dev-next'
|
||||
required: true
|
||||
type: string
|
||||
tag3:
|
||||
description: 'a new prerelease name or not, if value=0, then only upload-artifact'
|
||||
required: false
|
||||
type: string
|
||||
tag4:
|
||||
description: 'build tags'
|
||||
required: false
|
||||
type: string
|
||||
jobs:
|
||||
go:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{steps.go.outputs.version}}
|
||||
steps:
|
||||
- name: get latest go version
|
||||
id: go
|
||||
run: |
|
||||
echo version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||
|
||||
sing-box:
|
||||
runs-on: ubuntu-latest
|
||||
needs: go
|
||||
env:
|
||||
REPO: ${{ github.event.inputs.tag1 }}
|
||||
TAGS: ${{ github.event.inputs.tag4 }}
|
||||
outputs:
|
||||
version: ${{steps.sing-box.outputs.version}}
|
||||
tags: ${{steps.sing-box.outputs.tags}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
repository: ${{ github.event.inputs.tag1 }}
|
||||
ref: ${{ github.event.inputs.tag2 }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@v4.1.0
|
||||
with:
|
||||
go-version: ${{needs.go.outputs.version}}
|
||||
|
||||
- name: get sing-box version
|
||||
id: sing-box
|
||||
run: |
|
||||
git remote add sekai https://github.com/SagerNet/sing-box.git
|
||||
git fetch --tags sekai
|
||||
version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag)
|
||||
[ -z "$version" ] && version=${{ github.event.inputs.tag2 }}
|
||||
echo version=$version >> $GITHUB_OUTPUT
|
||||
if [ -z "$TAGS" ];then
|
||||
if [ "$REPO" = 'PuerNya/sing-box' ];then
|
||||
echo tags=with_quic,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_clash_api >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo tags=with_quic,with_ech,with_utls,with_reality_server,with_clash_api >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo tags=$TAGS >> $GITHUB_OUTPUT
|
||||
fi
|
||||
cross:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# linux
|
||||
- name: linux-amd64
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
goamd64: v1
|
||||
- name: linux-386
|
||||
goos: linux
|
||||
goarch: 386
|
||||
- name: linux-arm64
|
||||
goos: linux
|
||||
goarch: arm64
|
||||
- name: linux-armv5
|
||||
goos: linux
|
||||
goarch: arm
|
||||
goarm: 5
|
||||
- name: linux-armv7
|
||||
goos: linux
|
||||
goarch: arm
|
||||
goarm: 7
|
||||
- name: linux-mips-softfloat
|
||||
goos: linux
|
||||
goarch: mips
|
||||
gomips: softfloat
|
||||
- name: linux-mipsel-softfloat
|
||||
goos: linux
|
||||
goarch: mipsle
|
||||
gomips: softfloat
|
||||
- name: linux-mipsel-hardfloat
|
||||
goos: linux
|
||||
goarch: mipsle
|
||||
gomips: hardfloat
|
||||
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
needs: sing-box
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
GOAMD64: ${{ matrix.goamd64 }}
|
||||
GOARM: ${{ matrix.goarm }}
|
||||
GOMIPS: ${{ matrix.gomips }}
|
||||
CGO_ENABLED: 0
|
||||
TAGS: ${{needs.sing-box.outputs.tags}}
|
||||
VERSION: ${{needs.sing-box.outputs.version}}
|
||||
steps:
|
||||
- name: Checkout sing-box
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
with:
|
||||
repository: ${{ github.event.inputs.tag1 }}
|
||||
ref: ${{ github.event.inputs.tag2 }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ steps.go.outputs.version }}
|
||||
|
||||
- name: build core
|
||||
id: build
|
||||
run: go build -v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" ./cmd/sing-box
|
||||
|
||||
- name: Upload file to workspace
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.name }}
|
||||
path: sing-box
|
||||
|
||||
push_prerelease:
|
||||
needs:
|
||||
- cross
|
||||
- sing-box
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RELEASE: ${{ github.event.inputs.tag3 }}
|
||||
VERSION: ${{needs.sing-box.outputs.version}}
|
||||
steps:
|
||||
- name: Get upx
|
||||
run: |
|
||||
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
|
||||
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
||||
tar xf upx-3.96-amd64_linux.tar.xz
|
||||
tar xf upx-3.93-amd64_linux.tar.xz
|
||||
|
||||
- name: Download file from workspace
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./tmp
|
||||
|
||||
- name: Zip core by upx
|
||||
run: |
|
||||
archs=(amd64 armv5 armv7 arm64 mips-softfloat mipsel-hardfloat mipsel-softfloat)
|
||||
new_name=(amd64 armv5 armv7 armv8 mips-softfloat mipsle-hardfloat mipsle-softfloat)
|
||||
for((i=0;i<7;i++));do
|
||||
mv -f ./tmp/linux-${archs[i]}/sing-box ./tmp/singbox-linux-${new_name[i]}
|
||||
chmod +x ./tmp/singbox-linux-${new_name[i]}
|
||||
if [ "${archs[i]}" != "armv5" ];then
|
||||
if [[ ${archs[i]} = mips* ]];then
|
||||
./upx-3.93-amd64_linux/upx ./tmp/singbox-linux-${new_name[i]}
|
||||
else
|
||||
./upx-3.96-amd64_linux/upx ./tmp/singbox-linux-${new_name[i]}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
rm -fr upx*
|
||||
rm -fr ./tmp/core.tar.gz
|
||||
echo ${VERSION} > ./tmp/version
|
||||
|
||||
- name: Create Release and Upload Release Asset
|
||||
if: ${{ env.RELEASE != '0' }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: singbox_core${{ github.event.inputs.tag3 }}
|
||||
name: singbox_core${{ github.event.inputs.tag3 }}
|
||||
body: "The ${{env.VERSION}} version of ${{ github.event.inputs.tag1 }} \n这是${{ github.event.inputs.tag1 }}的${{env.VERSION}}版本内核文件\nhttps://github.com/${{ github.event.inputs.tag1 }}/releases \nZip by upx\n使用了upx进行压缩\nOnly support for ShellCrash\n仅限于ShellCrash项目使用"
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
./tmp/*
|
||||
|
||||
- name: upload artifact
|
||||
if: ${{ env.RELEASE == '0' }}
|
||||
uses: actions/upload-artifact@v4.1.0
|
||||
with:
|
||||
name: sing-box-${{env.VERSION}}-${{matrix.jobs.output}}
|
||||
path: |
|
||||
./tmp/sing-box*
|
||||
compression-level: 9
|
||||
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
21
README_CN.md
21
README_CN.md
@@ -101,9 +101,26 @@ export url='https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master' && wget -q
|
||||
export url='http://t.jwsc.eu.org' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
|
||||
```
|
||||
|
||||
~**DOCKER环境下安装:**<br>
|
||||
~**虚拟机/Docker环境安装:**<br>
|
||||
|
||||
虚拟机或Docker环境推荐使用Alpine镜像安装<br>
|
||||
|
||||
这里以Docker为例(其他虚拟机请自行查找安装Alpine镜像安装教程)<br>
|
||||
|
||||
```shell
|
||||
#注意,以下命令请分步执行!
|
||||
#Docker一键启动Alpine镜像
|
||||
docker run -d --name ShellCrash alpine sleep infinity
|
||||
#进入容器内sh环境
|
||||
docker exec -it ShellCrash sh
|
||||
#安装必要依赖
|
||||
apk add curl
|
||||
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
|
||||
```
|
||||
|
||||
|
||||
请参考 [ShellCrash_docker 一键脚本和镜像](https://github.com/echvoyager/shellCrash_docker)
|
||||
|
||||
### **本地安装:**<br>
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,6 @@
|
||||
2001:254::/31
|
||||
2001:256:100::/48
|
||||
2001:550:1601::/48
|
||||
2001:678:d3c::/48
|
||||
2001:67c:aec::/48
|
||||
2001:67c:c28::/48
|
||||
2001:7fa:5::/48
|
||||
@@ -13,8 +12,8 @@
|
||||
2001:dd8:1::/48
|
||||
2001:dd8:5::/48
|
||||
2001:dd9::/48
|
||||
2001:df0:2e00::/48
|
||||
2001:df0:ac40::/48
|
||||
2001:df1:2b40::/48
|
||||
2001:df1:5fc0::/48
|
||||
2001:df1:6b80::/48
|
||||
2001:df1:bd80::/48
|
||||
@@ -34,6 +33,7 @@
|
||||
2400:6000::/32
|
||||
2400:6460::/40
|
||||
2400:6600::/32
|
||||
2400:6e60:1301::/48
|
||||
2400:70e0:bed::/48
|
||||
2400:72e0:9f00::/40
|
||||
2400:73e0:201::/48
|
||||
@@ -64,7 +64,6 @@
|
||||
2400:9380:8001::/48
|
||||
2400:9380:8003::/48
|
||||
2400:9380:8021::/48
|
||||
2400:9380:8030::/48
|
||||
2400:9380:8040::/48
|
||||
2400:9380:8140::/48
|
||||
2400:9380:8201::/48
|
||||
@@ -75,7 +74,6 @@
|
||||
2400:9380:9009::/48
|
||||
2400:9380:900a::/48
|
||||
2400:9380:9020::/47
|
||||
2400:9380:9030::/47
|
||||
2400:9380:9040::/47
|
||||
2400:9380:9050::/47
|
||||
2400:9380:9060::/48
|
||||
@@ -88,7 +86,6 @@
|
||||
2400:9380:9201::/48
|
||||
2400:9380:9202::/48
|
||||
2400:9380:9220::/47
|
||||
2400:9380:9230::/47
|
||||
2400:9380:9240::/47
|
||||
2400:9380:9250::/47
|
||||
2400:9380:9252::/48
|
||||
@@ -110,7 +107,7 @@
|
||||
2400:be00::/48
|
||||
2400:da00::/32
|
||||
2400:dd00::/28
|
||||
2400:ebc0::/32
|
||||
2400:f6e0::/32
|
||||
2400:f720::/32
|
||||
2400:f7c0::/32
|
||||
2400:fb40::/32
|
||||
@@ -119,6 +116,8 @@
|
||||
2401:800::/32
|
||||
2401:1160::/32
|
||||
2401:11a0:150::/44
|
||||
2401:11a0:1500::/40
|
||||
2401:1200::/48
|
||||
2401:1320::/32
|
||||
2401:13a0:1::/48
|
||||
2401:1740:2000::/48
|
||||
@@ -132,6 +131,7 @@
|
||||
2401:3800::/32
|
||||
2401:5960:5960::/48
|
||||
2401:7700::/32
|
||||
2401:7d40::/32
|
||||
2401:7e00::/32
|
||||
2401:8d00::/46
|
||||
2401:8d00:7::/48
|
||||
@@ -156,7 +156,6 @@
|
||||
2401:cb80::/32
|
||||
2401:cc00::/32
|
||||
2401:ce00::/32
|
||||
2401:cec0::/32
|
||||
2401:d180::/46
|
||||
2401:d180:10::/47
|
||||
2401:d180:2120::/48
|
||||
@@ -175,6 +174,7 @@
|
||||
2402:4440::/32
|
||||
2402:4b80::/32
|
||||
2402:4e00::/32
|
||||
2402:5e40::/32
|
||||
2402:5ec0::/32
|
||||
2402:6e80::/32
|
||||
2402:6f40::/48
|
||||
@@ -198,6 +198,11 @@
|
||||
2402:dfc0::/44
|
||||
2402:dfc0:50::/44
|
||||
2402:e380:100::/40
|
||||
2402:e380:302::/48
|
||||
2402:e380:306::/48
|
||||
2402:e380:308::/48
|
||||
2402:e380:30c::/48
|
||||
2402:e380:312::/48
|
||||
2402:e480::/32
|
||||
2402:e740::/32
|
||||
2402:e7c0::/32
|
||||
@@ -215,6 +220,7 @@
|
||||
2403:1ec0:1400::/48
|
||||
2403:1ec0:1610::/48
|
||||
2403:2040::/32
|
||||
2403:27c0:c03::/48
|
||||
2403:27c0:1000::/48
|
||||
2403:2b40::/32
|
||||
2403:3140::/32
|
||||
@@ -281,6 +287,7 @@
|
||||
2404:2280:1d8::/45
|
||||
2404:2280:1e0::/48
|
||||
2404:2280:1e2::/47
|
||||
2404:2280:1e4::/47
|
||||
2404:6380::/48
|
||||
2404:6380:1000::/48
|
||||
2404:6380:8001::/48
|
||||
@@ -294,8 +301,6 @@
|
||||
2404:7180:b001::/48
|
||||
2404:7180:b002::/48
|
||||
2404:7180:b010::/48
|
||||
2404:7180:b021::/48
|
||||
2404:7180:b022::/48
|
||||
2404:7180:c001::/48
|
||||
2404:7180:c002::/48
|
||||
2404:7180:c011::/48
|
||||
@@ -321,6 +326,7 @@
|
||||
2404:e280::/47
|
||||
2404:e5c0::/32
|
||||
2404:e8c0::/32
|
||||
2404:ea80:400:129::/64
|
||||
2404:ea80:400:2116::/64
|
||||
2404:ea80:500:575::/64
|
||||
2404:ea80:600:623::/64
|
||||
@@ -348,6 +354,8 @@
|
||||
2405:6f00:c602::/48
|
||||
2405:7040:6000::/47
|
||||
2405:78c0:6e00::/43
|
||||
2405:8280::/32
|
||||
2405:84c0:ff80::/44
|
||||
2405:8a40::/32
|
||||
2405:a900:ffee::/48
|
||||
2405:a900:fffe::/48
|
||||
@@ -370,7 +378,7 @@
|
||||
2406:840:100::/48
|
||||
2406:840:1c0::/48
|
||||
2406:840:301::/48
|
||||
2406:840:380::/48
|
||||
2406:840:410::/48
|
||||
2406:840:800::/42
|
||||
2406:840:840::/47
|
||||
2406:840:860::/48
|
||||
@@ -383,7 +391,6 @@
|
||||
2406:840:2800::/48
|
||||
2406:840:3800::/48
|
||||
2406:840:4100::/47
|
||||
2406:840:4380::/47
|
||||
2406:840:4800::/47
|
||||
2406:840:4880::/47
|
||||
2406:840:5100::/47
|
||||
@@ -391,7 +398,7 @@
|
||||
2406:840:5860::/47
|
||||
2406:840:5880::/47
|
||||
2406:840:8100::/40
|
||||
2406:840:9000::/46
|
||||
2406:840:9000::/44
|
||||
2406:840:9100::/47
|
||||
2406:840:9102::/48
|
||||
2406:840:9200::/40
|
||||
@@ -419,12 +426,11 @@
|
||||
2406:840:e180::/44
|
||||
2406:840:e20f::/48
|
||||
2406:840:e230::/48
|
||||
2406:840:e280::/47
|
||||
2406:840:e280::/48
|
||||
2406:840:e300::/47
|
||||
2406:840:e340::/44
|
||||
2406:840:e36f::/48
|
||||
2406:840:e501::/48
|
||||
2406:840:e571::/48
|
||||
2406:840:e500::/47
|
||||
2406:840:e576::/48
|
||||
2406:840:e57b::/48
|
||||
2406:840:e57f::/48
|
||||
@@ -440,16 +446,16 @@
|
||||
2406:840:e84c::/47
|
||||
2406:840:e84f::/48
|
||||
2406:840:e880::/44
|
||||
2406:840:eab0::/48
|
||||
2406:840:eab2::/47
|
||||
2406:840:eabf::/48
|
||||
2406:840:eab0::/46
|
||||
2406:840:eab4::/48
|
||||
2406:840:eab6::/48
|
||||
2406:840:eb00::/46
|
||||
2406:840:eb04::/47
|
||||
2406:840:eb07::/48
|
||||
2406:840:eb08::/47
|
||||
2406:840:eb0b::/48
|
||||
2406:840:eb0f::/48
|
||||
2406:840:eb80::/42
|
||||
2406:840:eeee::/48
|
||||
2406:840:efa0::/44
|
||||
2406:840:f0a1::/48
|
||||
2406:840:f0aa::/48
|
||||
2406:840:f100::/47
|
||||
@@ -472,11 +478,12 @@
|
||||
2406:840:fd06::/48
|
||||
2406:840:fd1f::/48
|
||||
2406:840:fe27::/48
|
||||
2406:840:fe40::/48
|
||||
2406:840:fe4a::/48
|
||||
2406:840:fe50::/48
|
||||
2406:840:fe60::/48
|
||||
2406:840:fe72::/47
|
||||
2406:840:fec0::/47
|
||||
2406:840:fec4::/48
|
||||
2406:840:fec8::/48
|
||||
2406:840:fed1::/48
|
||||
2406:840:fed2::/47
|
||||
@@ -501,6 +508,7 @@
|
||||
2406:52c0::/32
|
||||
2406:5340:6666::/48
|
||||
2406:5340:8888::/48
|
||||
2406:5ac0::/32
|
||||
2406:94c0::/48
|
||||
2406:b640:100::/48
|
||||
2406:b640:4100::/48
|
||||
@@ -511,6 +519,7 @@
|
||||
2406:d440:300::/44
|
||||
2406:d440:500::/48
|
||||
2406:d440:600::/48
|
||||
2406:e3c0::/32
|
||||
2406:e500::/33
|
||||
2407:2840::/48
|
||||
2407:3740::/48
|
||||
@@ -522,6 +531,7 @@
|
||||
2407:6c40:1500::/48
|
||||
2407:6c40:1810::/48
|
||||
2407:7d00:1::/48
|
||||
2407:8f40:2::/48
|
||||
2407:9f00::/32
|
||||
2407:ad80::/32
|
||||
2407:ae80::/32
|
||||
@@ -993,8 +1003,7 @@
|
||||
2408:8962::/31
|
||||
2408:8964::/31
|
||||
2408:8966::/32
|
||||
2408:896c::/32
|
||||
2408:896e::/31
|
||||
2408:896c::/30
|
||||
2408:8978::/30
|
||||
2408:897e::/32
|
||||
2408:8a00:c000::/36
|
||||
@@ -1108,14 +1117,15 @@
|
||||
240e::/20
|
||||
2602:2a3::/40
|
||||
2602:2a4:ff::/48
|
||||
2602:f9a9:101::/48
|
||||
2602:f9ba:a9::/48
|
||||
2602:f9df:400::/48
|
||||
2602:f9df:410::/48
|
||||
2602:f9df:420::/48
|
||||
2602:f9df:500::/48
|
||||
2602:f9df:505::/48
|
||||
2602:f9df:510::/47
|
||||
2602:f9f6::/40
|
||||
2602:f9f6:400::/44
|
||||
2602:f9f6:c01::/48
|
||||
2602:f9f6:f00::/40
|
||||
2602:fa1c:121::/48
|
||||
2602:fab0:11::/48
|
||||
2602:fbda:600::/48
|
||||
@@ -1124,7 +1134,6 @@
|
||||
2602:fc52:311::/48
|
||||
2602:fc52:312::/48
|
||||
2602:fc52:315::/48
|
||||
2602:fd50:20::/48
|
||||
2602:fd92:800::/40
|
||||
2602:fe69:f26::/47
|
||||
2602:fed2:7020::/46
|
||||
@@ -1148,6 +1157,7 @@
|
||||
2602:feda:ca1::/48
|
||||
2602:feda:d80::/48
|
||||
2602:feda:d83::/48
|
||||
2602:ffe4:c5f::/48
|
||||
2605:640f:bcd7::/48
|
||||
2605:9d80:8001::/48
|
||||
2605:9d80:8011::/48
|
||||
@@ -1167,7 +1177,6 @@
|
||||
2605:f440:cafe::/48
|
||||
2607:7640::/48
|
||||
2804:1e48::/32
|
||||
2a03:5840:f3::/48
|
||||
2a03:5840:290::/48
|
||||
2a04:3e00:1002::/48
|
||||
2a04:f580:8010::/47
|
||||
@@ -1203,6 +1212,7 @@
|
||||
2a05:1087::/32
|
||||
2a05:dfc1:1602::/48
|
||||
2a05:dfc1:16ff::/48
|
||||
2a05:dfc1:5900::/41
|
||||
2a05:dfc1:5a00::/40
|
||||
2a05:dfc1:6601::/48
|
||||
2a05:dfc1:6607::/48
|
||||
@@ -1222,6 +1232,7 @@
|
||||
2a05:dfc1:8c24::/48
|
||||
2a05:dfc1:8c40::/48
|
||||
2a05:dfc1:8c90::/47
|
||||
2a05:dfc1:8c94::/47
|
||||
2a05:dfc1:8c98::/47
|
||||
2a05:dfc1:8d00::/48
|
||||
2a05:dfc1:8d02::/48
|
||||
@@ -1232,7 +1243,9 @@
|
||||
2a06:a005:486::/48
|
||||
2a06:a005:8d0::/47
|
||||
2a06:a005:8da::/48
|
||||
2a06:a005:910::/44
|
||||
2a06:a005:9c0::/48
|
||||
2a06:a005:a13::/48
|
||||
2a06:a005:b69::/48
|
||||
2a06:a005:d22::/48
|
||||
2a06:a005:f80::/44
|
||||
@@ -1247,8 +1260,12 @@
|
||||
2a06:a005:1700::/44
|
||||
2a06:a005:1800::/48
|
||||
2a06:a005:1b60::/47
|
||||
2a06:a005:1c40::/44
|
||||
2a06:a005:1ee1::/48
|
||||
2a06:a005:1eee::/48
|
||||
2a06:a005:2040::/44
|
||||
2a06:a005:2100::/44
|
||||
2a06:a005:2200::/44
|
||||
2a06:a005:2510::/48
|
||||
2a06:a005:28f3::/48
|
||||
2a06:a005:28f4::/48
|
||||
@@ -1260,31 +1277,34 @@
|
||||
2a06:a005:2980::/44
|
||||
2a06:a005:29d1::/48
|
||||
2a06:de00:de04::/48
|
||||
2a06:de00:de0e::/48
|
||||
2a06:de01:809::/48
|
||||
2a06:de01:814::/48
|
||||
2a06:de01:83c::/48
|
||||
2a06:de01:85c::/48
|
||||
2a06:de01:87e::/48
|
||||
2a06:de01:8a3::/48
|
||||
2a06:de01:8a9::/48
|
||||
2a06:de01:8bb::/48
|
||||
2a06:de01:8c9::/48
|
||||
2a06:de01:8ca::/48
|
||||
2a06:de01:8dd::/48
|
||||
2a06:de01:928::/48
|
||||
2a06:de01:92d::/48
|
||||
2a06:de01:92f::/48
|
||||
2a06:de01:952::/48
|
||||
2a06:de01:964::/48
|
||||
2a06:de01:987::/48
|
||||
2a06:de01:9a1::/48
|
||||
2a06:de00:de0e::/47
|
||||
2a06:de01:804::/48
|
||||
2a06:de01:81e::/48
|
||||
2a06:de01:824::/48
|
||||
2a06:de01:861::/48
|
||||
2a06:de01:869::/48
|
||||
2a06:de01:876::/48
|
||||
2a06:de01:885::/48
|
||||
2a06:de01:8a1::/48
|
||||
2a06:de01:8bd::/48
|
||||
2a06:de01:8cb::/48
|
||||
2a06:de01:8ce::/48
|
||||
2a06:de01:8f5::/48
|
||||
2a06:de01:907::/48
|
||||
2a06:de01:912::/48
|
||||
2a06:de01:927::/48
|
||||
2a06:de01:942::/48
|
||||
2a06:de01:947::/48
|
||||
2a06:de01:959::/48
|
||||
2a06:de01:9a9::/48
|
||||
2a06:de01:ae0::/48
|
||||
2a06:de01:aec::/48
|
||||
2a06:de01:af2::/48
|
||||
2a06:de01:b18::/48
|
||||
2a06:de01:b3f::/48
|
||||
2a06:de01:9aa::/48
|
||||
2a06:de01:9be::/48
|
||||
2a06:de01:ac1::/48
|
||||
2a06:de01:ad6::/48
|
||||
2a06:de01:aef::/48
|
||||
2a06:de01:afe::/48
|
||||
2a06:de01:b12::/48
|
||||
2a06:de01:b26::/48
|
||||
2a06:e881:2509::/48
|
||||
2a06:e881:5501::/48
|
||||
2a06:e881:5502::/48
|
||||
@@ -1292,7 +1312,6 @@
|
||||
2a06:e881:6600::/48
|
||||
2a06:e881:6602::/47
|
||||
2a06:e881:6606::/48
|
||||
2a07:54c7:3010::/48
|
||||
2a09:b280:ff80::/47
|
||||
2a09:b280:ff83::/48
|
||||
2a09:b280:ff84::/47
|
||||
@@ -1308,7 +1327,7 @@
|
||||
2a0a:6040:e02::/47
|
||||
2a0a:6040:ea0::/48
|
||||
2a0a:6040:f00::/48
|
||||
2a0a:6040:f10::/47
|
||||
2a0a:6040:f11::/48
|
||||
2a0a:6040:1b00::/40
|
||||
2a0a:6040:2211::/48
|
||||
2a0a:6040:2222::/48
|
||||
@@ -1328,10 +1347,9 @@
|
||||
2a0a:6040:6c40::/44
|
||||
2a0a:6040:a430::/48
|
||||
2a0a:6040:a450::/47
|
||||
2a0a:6040:a720::/48
|
||||
2a0a:6040:a730::/48
|
||||
2a0a:6040:a740::/48
|
||||
2a0a:6040:a900::/47
|
||||
2a0a:6040:a901::/48
|
||||
2a0a:6040:b770::/44
|
||||
2a0a:6040:c601::/48
|
||||
2a0a:6040:c700::/42
|
||||
@@ -1345,10 +1363,9 @@
|
||||
2a0a:6040:d0fe::/48
|
||||
2a0a:6040:d401::/48
|
||||
2a0a:6040:d600::/44
|
||||
2a0a:6040:d610::/48
|
||||
2a0a:6040:d610::/47
|
||||
2a0a:6040:d612::/48
|
||||
2a0a:6040:d615::/48
|
||||
2a0a:6040:d616::/48
|
||||
2a0a:6040:d614::/46
|
||||
2a0a:6040:d710::/44
|
||||
2a0a:6040:e100::/40
|
||||
2a0a:6040:e541::/48
|
||||
@@ -1360,6 +1377,7 @@
|
||||
2a0a:6040:e900::/40
|
||||
2a0a:6040:ec00::/40
|
||||
2a0b:b86:ffe0::/48
|
||||
2a0b:b87:ffb5::/48
|
||||
2a0b:2542::/48
|
||||
2a0b:2542:300::/40
|
||||
2a0b:4340:6::/48
|
||||
@@ -1389,13 +1407,15 @@
|
||||
2a0c:b641:210::/47
|
||||
2a0c:b641:24f::/48
|
||||
2a0c:b641:312::/48
|
||||
2a0c:b641:510::/48
|
||||
2a0c:b641:570::/47
|
||||
2a0c:b641:730::/44
|
||||
2a0c:b641:a11::/48
|
||||
2a0c:b641:a60::/44
|
||||
2a0c:b641:b21::/48
|
||||
2a0c:b641:b25::/48
|
||||
2a0c:b642:4101::/48
|
||||
2a0c:b642:4102::/47
|
||||
2a0c:b642:4104::/47
|
||||
2a0d:2146:8040::/48
|
||||
2a0d:2406:510::/46
|
||||
2a0d:2580:ff00::/45
|
||||
@@ -1407,6 +1427,7 @@
|
||||
2a0d:2683:2::/48
|
||||
2a0d:2687::/32
|
||||
2a0d:2904::/44
|
||||
2a0d:2906:f000::/44
|
||||
2a0d:c7c7::/32
|
||||
2a0e:800:ff00::/48
|
||||
2a0e:800:ff04::/48
|
||||
@@ -1426,6 +1447,7 @@
|
||||
2a0e:aa06:440::/48
|
||||
2a0e:aa06:470::/44
|
||||
2a0e:aa06:490::/44
|
||||
2a0e:aa06:4e0::/44
|
||||
2a0e:aa07:e00e::/48
|
||||
2a0e:aa07:e01b::/48
|
||||
2a0e:aa07:e024::/46
|
||||
@@ -1434,7 +1456,6 @@
|
||||
2a0e:aa07:e039::/48
|
||||
2a0e:aa07:e03a::/48
|
||||
2a0e:aa07:e043::/48
|
||||
2a0e:aa07:e044::/48
|
||||
2a0e:aa07:e050::/44
|
||||
2a0e:aa07:e060::/48
|
||||
2a0e:aa07:e073::/48
|
||||
@@ -1443,12 +1464,13 @@
|
||||
2a0e:aa07:e120::/44
|
||||
2a0e:aa07:e130::/47
|
||||
2a0e:aa07:e141::/48
|
||||
2a0e:aa07:e142::/47
|
||||
2a0e:aa07:e143::/48
|
||||
2a0e:aa07:e145::/48
|
||||
2a0e:aa07:e16a::/48
|
||||
2a0e:aa07:e200::/44
|
||||
2a0e:aa07:f000::/48
|
||||
2a0e:aa07:f004::/48
|
||||
2a0e:aa07:f009::/48
|
||||
2a0e:aa07:f008::/48
|
||||
2a0e:aa07:f041::/48
|
||||
2a0e:aa07:f042::/48
|
||||
2a0e:aa07:f0d0::/47
|
||||
@@ -1475,17 +1497,20 @@
|
||||
2a0e:b107:1b6f::/48
|
||||
2a0e:b107:1d20::/47
|
||||
2a0e:b107:1d25::/48
|
||||
2a0e:b107:2222::/48
|
||||
2a0e:b107:1e85::/48
|
||||
2a0f:1440::/29
|
||||
2a0f:2100::/29
|
||||
2a0f:5707:ac01::/48
|
||||
2a0f:5707:fe01::/48
|
||||
2a0f:5707:fff4::/47
|
||||
2a0f:7803:fc00::/39
|
||||
2a0f:7803:fe81::/48
|
||||
2a0f:7803:fc00::/44
|
||||
2a0f:7803:fc30::/44
|
||||
2a0f:7803:fd00::/40
|
||||
2a0f:7803:fe23::/48
|
||||
2a0f:7803:fe80::/47
|
||||
2a0f:7803:fe82::/48
|
||||
2a0f:7803:ff10::/48
|
||||
2a0f:7803:ffd0::/47
|
||||
2a0f:7980::/44
|
||||
2a0f:85c1:30::/47
|
||||
2a0f:85c1:100::/47
|
||||
2a0f:9400:6110::/48
|
||||
2a0f:9400:7700::/48
|
||||
@@ -1494,7 +1519,7 @@
|
||||
2a10:2f00:15a::/48
|
||||
2a10:2f00:18e::/48
|
||||
2a10:2f01:100::/48
|
||||
2a10:cc40:180::/48
|
||||
2a10:cc40:180::/47
|
||||
2a10:cc40:188::/48
|
||||
2a10:cc40:190::/48
|
||||
2a10:cc42:120::/43
|
||||
@@ -1503,13 +1528,13 @@
|
||||
2a10:ccc0:ccc::/48
|
||||
2a10:ccc0:ccc6::/48
|
||||
2a10:ccc0:cccc::/46
|
||||
2a10:ccc1:105::/48
|
||||
2a11:f2c0:ffc4::/48
|
||||
2a12:3fc2:6600::/48
|
||||
2a12:3fc2:6666::/48
|
||||
2a12:3fc2:aa10::/44
|
||||
2a12:3fc2:aa40::/44
|
||||
2a12:3fc2:ab50::/48
|
||||
2a12:3fc2:e500::/40
|
||||
2a12:3fc2:e72e::/48
|
||||
2a12:3fc2:e810::/44
|
||||
2a12:3fc7::/48
|
||||
@@ -1526,23 +1551,17 @@
|
||||
2a13:1800:300::/44
|
||||
2a13:1801:180::/43
|
||||
2a13:1802::/44
|
||||
2a13:a5c3:1000::/36
|
||||
2a13:a5c3:2000::/35
|
||||
2a13:a5c3:4000::/36
|
||||
2a13:a5c3:f000::/40
|
||||
2a13:a5c4:1000::/38
|
||||
2a13:a5c4:1400::/39
|
||||
2a13:a5c7:1200::/40
|
||||
2a13:a5c7:1500::/40
|
||||
2a13:a5c7:1600::/45
|
||||
2a13:a5c7:1608::/47
|
||||
2a13:a5c7:160a::/48
|
||||
2a13:a5c7:1802::/48
|
||||
2a13:b487:1200::/43
|
||||
2a13:b487:1b86::/48
|
||||
2a13:b487:1bb2::/48
|
||||
2a13:b487:1bb7::/48
|
||||
2a13:b487:1bbb::/48
|
||||
2a13:b487:1f00::/47
|
||||
2a13:b487:4100::/40
|
||||
2a13:b487:1f00::/45
|
||||
2a13:b487:4200::/47
|
||||
2a13:b487:4210::/44
|
||||
2a13:b487:4220::/43
|
||||
@@ -1550,10 +1569,10 @@
|
||||
2a13:b487:42d0::/44
|
||||
2a13:df80:6808::/48
|
||||
2a13:df85:be00::/48
|
||||
2a13:df85:be10::/48
|
||||
2a13:df85:be80::/48
|
||||
2a13:df85:be88::/48
|
||||
2a13:df85:be90::/48
|
||||
2a13:df85:beaa::/48
|
||||
2a13:df85:befe::/48
|
||||
2c0f:f7a8:8011::/48
|
||||
2c0f:f7a8:8050::/48
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
BIN
bin/geodata/geoip_cn.db
Normal file
BIN
bin/geodata/geoip_cn.db
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 276 KiB |
87411
bin/geodata/geosite.dat
87411
bin/geodata/geosite.dat
File diff suppressed because one or more lines are too long
BIN
bin/geodata/geosite_cn.db
Normal file
BIN
bin/geodata/geosite_cn.db
Normal file
Binary file not shown.
BIN
bin/meta/clash-linux-amd64
Normal file → Executable file
BIN
bin/meta/clash-linux-amd64
Normal file → Executable file
Binary file not shown.
BIN
bin/meta/clash-linux-armv5
Normal file → Executable file
BIN
bin/meta/clash-linux-armv5
Normal file → Executable file
Binary file not shown.
BIN
bin/meta/clash-linux-armv7
Normal file → Executable file
BIN
bin/meta/clash-linux-armv7
Normal file → Executable file
Binary file not shown.
BIN
bin/meta/clash-linux-armv8
Normal file → Executable file
BIN
bin/meta/clash-linux-armv8
Normal file → Executable file
Binary file not shown.
BIN
bin/meta/clash-linux-mips-softfloat
Normal file → Executable file
BIN
bin/meta/clash-linux-mips-softfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/meta/clash-linux-mipsle-hardfloat
Normal file → Executable file
BIN
bin/meta/clash-linux-mipsle-hardfloat
Normal file → Executable file
Binary file not shown.
BIN
bin/meta/clash-linux-mipsle-softfloat
Normal file → Executable file
BIN
bin/meta/clash-linux-mipsle-softfloat
Normal file → Executable file
Binary file not shown.
Binary file not shown.
BIN
bin/singbox/singbox-linux-amd64
Executable file
BIN
bin/singbox/singbox-linux-amd64
Executable file
Binary file not shown.
BIN
bin/singbox/singbox-linux-armv5
Executable file
BIN
bin/singbox/singbox-linux-armv5
Executable file
Binary file not shown.
BIN
bin/singbox/singbox-linux-armv7
Executable file
BIN
bin/singbox/singbox-linux-armv7
Executable file
Binary file not shown.
BIN
bin/singbox/singbox-linux-armv8
Executable file
BIN
bin/singbox/singbox-linux-armv8
Executable file
Binary file not shown.
BIN
bin/singbox/singbox-linux-mips-softfloat
Executable file
BIN
bin/singbox/singbox-linux-mips-softfloat
Executable file
Binary file not shown.
BIN
bin/singbox/singbox-linux-mipsle-hardfloat
Executable file
BIN
bin/singbox/singbox-linux-mipsle-hardfloat
Executable file
Binary file not shown.
BIN
bin/singbox/singbox-linux-mipsle-softfloat
Executable file
BIN
bin/singbox/singbox-linux-mipsle-softfloat
Executable file
Binary file not shown.
@@ -1,6 +1,8 @@
|
||||
clashnet_v=v1.7.6
|
||||
clashpre_v=2022.11.25
|
||||
clash_v=v1.7.1
|
||||
meta_v=v1.17.0
|
||||
GeoIP_v=20231230
|
||||
versionsh=1.8.3c
|
||||
meta_v=v1.18.0
|
||||
|
||||
singbox_v=1.8.4
|
||||
GeoIP_v=20240127
|
||||
versionsh=1.8.9d
|
||||
|
||||
60
install.sh
60
install.sh
@@ -1,12 +1,14 @@
|
||||
#! /bin/bash
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
[ -z "$url" ] && url="https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master"
|
||||
type bash &>/dev/null && shtype=bash || shtype=sh
|
||||
echo='echo -e'
|
||||
[ -n "$(echo -e|grep e)" ] && {
|
||||
echo "\033[31m不支持dash环境安装!请先输入bash命令后再运行安装命令!\033[0m"
|
||||
exit
|
||||
}
|
||||
|
||||
echo "***********************************************"
|
||||
echo "** 欢迎使用 **"
|
||||
echo "** ShellCrash **"
|
||||
@@ -47,7 +49,7 @@ error_down(){
|
||||
}
|
||||
#安装及初始化
|
||||
gettar(){
|
||||
webget /tmp/ShellCrash.tar.gz $tarurl
|
||||
webget /tmp/ShellCrash.tar.gz "$url/bin/ShellCrash.tar.gz"
|
||||
if [ "$result" != "200" ];then
|
||||
$echo "\033[33m文件下载失败!\033[0m"
|
||||
error_down
|
||||
@@ -174,7 +176,7 @@ if [ ! -w $dir ];then
|
||||
else
|
||||
$echo "目标目录\033[32m$dir\033[0m空间剩余:$(dir_avail $dir -h)"
|
||||
read -p "确认安装?(1/0) > " res
|
||||
[ "$res" = "1" ] && CRASHDIR=$dir/clash || setdir
|
||||
[ "$res" = "1" ] && CRASHDIR=$dir/ShellCrash || setdir
|
||||
fi
|
||||
}
|
||||
install(){
|
||||
@@ -190,7 +192,25 @@ echo -----------------------------------------------
|
||||
$echo "\033[33m输入\033[30;47m crash \033[0;33m命令即可管理!!!\033[0m"
|
||||
echo -----------------------------------------------
|
||||
}
|
||||
|
||||
setversion(){
|
||||
echo -----------------------------------------------
|
||||
$echo "\033[33m请选择想要安装的版本:\033[0m"
|
||||
$echo " 1 \033[32m公测版(推荐)\033[0m"
|
||||
$echo " 2 \033[36m稳定版\033[0m"
|
||||
$echo " 3 \033[31m开发版\033[0m"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入相应数字 > " num
|
||||
case "$num" in
|
||||
2)
|
||||
url=$(echo $url | sed 's/master/stable/')
|
||||
;;
|
||||
3)
|
||||
url=$(echo $url | sed 's/master/dev/')
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
#特殊固件识别及标记
|
||||
[ -f "/etc/storage/started_script.sh" ] && {
|
||||
systype=Padavan #老毛子固件
|
||||
@@ -213,36 +233,16 @@ if [ "$USER" != "root" -a -z "$systype" ];then
|
||||
[ "$res" != "1" ] && exit 1
|
||||
fi
|
||||
|
||||
#检查更新
|
||||
url_cdn="https://fastly.jsdelivr.net/gh/juewuy/ShellCrash"
|
||||
[ -z "$url" ] && url=$url_cdn
|
||||
echo -----------------------------------------------
|
||||
$echo "\033[33m请选择想要安装的版本:\033[0m"
|
||||
$echo " 1 \033[32mShellCrash公测版\033[0m"
|
||||
$echo " 2 \033[36mShellCrash稳定版\033[0m"
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入相应数字 > " num
|
||||
if [ -z $num ];then
|
||||
echo 安装已取消! && exit 1;
|
||||
elif [ "$num" = "2" ];then
|
||||
webget /tmp/clashrelease $url_cdn@master/bin/release_version echoon rediroff 2>/tmp/clashrelease
|
||||
if [ "$result" = "200" ];then
|
||||
release_new=$(cat /tmp/clashrelease | head -1)
|
||||
url_dl="$url_cdn@$release_new"
|
||||
else
|
||||
$echo "\033[33m无法获取稳定版安装地址,将尝试安装公测版!\033[0m"
|
||||
fi
|
||||
if [ -n "$(echo $url | grep master)" ];then
|
||||
setversion
|
||||
fi
|
||||
[ -z "$url_dl" ] && url_dl=$url
|
||||
webget /tmp/clashversion "$url_dl/bin/version" echooff
|
||||
[ "$result" = "200" ] && versionsh=$(cat /tmp/clashversion | grep "versionsh" | awk -F "=" '{print $2}')
|
||||
[ -z "$release_new" ] && release_new=$versionsh
|
||||
rm -rf /tmp/clashversion
|
||||
rm -rf /tmp/clashrelease
|
||||
tarurl=$url_dl/bin/ShellCrash.tar.gz
|
||||
#获取版本信息
|
||||
webget /tmp/version "$url/bin/version" echooff
|
||||
[ "$result" = "200" ] && versionsh=$(cat /tmp/version | grep "versionsh" | awk -F "=" '{print $2}')
|
||||
rm -rf /tmp/version
|
||||
|
||||
#输出
|
||||
$echo "最新版本:\033[32m$release_new\033[0m"
|
||||
$echo "最新版本:\033[32m$versionsh\033[0m"
|
||||
echo -----------------------------------------------
|
||||
$echo "\033[44m如遇问题请加TG群反馈:\033[42;30m t.me/ShellClash \033[0m"
|
||||
$echo "\033[37m支持各种基于openwrt的路由器设备"
|
||||
|
||||
@@ -1,32 +1,30 @@
|
||||
# ID&类型 说明 地址 其他说明 (类型:100-稳定源;200-测试源;300-基础sub;400-meta_sub;500-规则地址)
|
||||
# ID&类型 说明 地址 其他说明 (类型:100-三版全通源;200-单一源;300-基础sub;400-meta_sub;500-规则地址)
|
||||
|
||||
101 Jsdelivr-CDN源 https://fastly.jsdelivr.net/gh/juewuy/ShellClash 稳定版
|
||||
102 Github源(须clash服务启用) https://raw.githubusercontent.com/juewuy/ShellClash 稳定版
|
||||
101 Jsdelivr_CDN源 https://fastly.jsdelivr.net/gh/juewuy/ShellCrash
|
||||
102 Github直连源(请注意网络环境) https://raw.githubusercontent.com/juewuy/ShellCrash
|
||||
103 ShellClash自建源(请勿滥用!) https://gh.jwsc.eu.org
|
||||
104 Cloudflare_CDN源 https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash
|
||||
|
||||
201 Jsdelivr-CDN源 https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master 公测版
|
||||
202 ShellClash自建源 https://gh.jwsc.eu.org/master 公测版
|
||||
203 ShellClash-cfworkers源 https://gh.shellclash.workers.dev/https://raw.githubusercontent.com/juewuy/ShellClash 公测版
|
||||
204 Github源(须clash服务启用) https://raw.githubusercontent.com/juewuy/ShellClash/master 公测版
|
||||
205 (请加讨论组-https://t.me/ShellClash) http://t.jwsc.eu.org 内测版
|
||||
206 wwng2333自建CN源 https://mirrors.csgo.ovh/ShellClash 公测版
|
||||
201 wwng2333自建CN源(请勿滥用!) https://mirrors.csgo.ovh/ShellClash 公测版
|
||||
202 http私人内测源(危险!非必要请勿使用) http://t.jwsc.eu.org 开发版
|
||||
|
||||
301 墙洞提供 https://api.dler.io
|
||||
302 SUB作者提供 https://sub.xeton.dev
|
||||
303 猫熊提供 https://sub.maoxiongnet.com
|
||||
301 墙洞提供,不支持vless|hy https://api.dler.io
|
||||
302 SUB作者提供,不支持vless|hy https://sub.xeton.dev
|
||||
303 品云提供,不支持vless|hy https://sub.id9.cc
|
||||
|
||||
401 肥羊提供(有广告),支持vless|hy https://sub.d1.mk
|
||||
402 品云提供,支持vless|hy https://v.id9.cc
|
||||
403 作者提供,支持vless|hy https://sub.jwsc.eu.org
|
||||
401 肥羊提供(有广告),支持vless|hy2 https://sub.d1.mk
|
||||
402 作者提供,支持vless|hy2 https://sub.jwsc.eu.org
|
||||
403 肥羊提供(有广告),支持vless|hy2 https://api.v1.mk
|
||||
|
||||
497 作者提供,未加密仅备用 http://sub2.jwsc.eu.org
|
||||
498 本地服务器 http://127.0.0.1:25500
|
||||
|
||||
501 Acl4SSR全能优化版 https://github.com/juewuy/ShellClash/raw/master/rules/ShellClash.ini (推荐)
|
||||
502 Acl4SSR精简优化版 https://github.com/juewuy/ShellClash/raw/master/rules/ShellClash_Mini.ini (推荐)
|
||||
503 Acl4SSR全能优化+去广告增强 https://github.com/juewuy/ShellClash/raw/master/rules/ShellClash_Block.ini
|
||||
504 Acl4SSR极简版 https://github.com/juewuy/ShellClash/raw/master/rules/ShellClash_Nano.ini (适合自建节点)
|
||||
505 Acl4SSR分流&游戏增强 https://github.com/juewuy/ShellClash/raw/master/rules/ShellClash_Full.ini
|
||||
506 Acl4SSR分流&游戏&去广告增强 https://github.com/juewuy/ShellClash/raw/master/rules/ShellClash_Full_Block.ini (低性能设备慎用)
|
||||
501 Acl4SSR全能优化版 https://github.com/juewuy/ShellCrash/raw/master/rules/ShellClash.ini (推荐)
|
||||
502 Acl4SSR精简优化版 https://github.com/juewuy/ShellCrash/raw/master/rules/ShellClash_Mini.ini (推荐)
|
||||
503 Acl4SSR全能优化+去广告增强 https://github.com/juewuy/ShellCrash/raw/master/rules/ShellClash_Block.ini
|
||||
504 Acl4SSR极简版 https://github.com/juewuy/ShellCrash/raw/master/rules/ShellClash_Nano.ini (适合自建节点)
|
||||
505 Acl4SSR分流&游戏增强 https://github.com/juewuy/ShellCrash/raw/master/rules/ShellClash_Full.ini
|
||||
506 Acl4SSR分流&游戏&去广告增强 https://github.com/juewuy/ShellCrash/raw/master/rules/ShellClash_Full_Block.ini (低性能设备慎用)
|
||||
507 洞主规则精简版 https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_clash.ini
|
||||
508 洞主规则重度完整版 https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_dler.ini
|
||||
509 Acl4SSR多国精简 https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiCountry.ini
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
101#$CRASHDIR/start.sh start#启动clash服务
|
||||
102#$CRASHDIR/start.sh stop#停止clash服务
|
||||
103#$CRASHDIR/start.sh restart#重启clash服务
|
||||
104#$CRASHDIR/start.sh getyaml && $CRASHDIR/start.sh restart#更新订阅并重启服务
|
||||
105#$CRASHDIR/start.sh updateyaml#热更新订阅
|
||||
104#$CRASHDIR/start.sh update_config#更新订阅并重启服务
|
||||
105#$CRASHDIR/start.sh hotupdate#热更新订阅
|
||||
106#$CRASHDIR/start.sh web_save#自动保存面板配置
|
||||
107#$CRASHDIR/start.sh ntp#自动同步ntp时间
|
||||
107#$CRASHDIR/task/task.sh ntp#自动同步ntp时间
|
||||
|
||||
111#$CRASHDIR/task/task.sh update_core#自动更新内核
|
||||
112#$CRASHDIR/task/task.sh update_shellclash#自动更新脚本
|
||||
113#$CRASHDIR/task/task.sh update_mmdb#自动更新数据库文件
|
||||
|
||||
121#$CRASHDIR/task/task.sh reset_firewall#重设透明路由防火墙
|
||||
122#reboot#重启路由设备(慎用)
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ ruleset=🛑 广告拦截,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/mast
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/LM-Firefly/Rules/master/Global-Services/Netflix.list
|
||||
ruleset=🎥 奈飞解锁,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/Ruleset/DisneyPlus.list
|
||||
ruleset=🤖 人工智能,https://raw.githubusercontent.com/juewuy/ShellClash/master/rules/ai.list
|
||||
ruleset=🚀 节点选择,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/ProxyLite.list
|
||||
ruleset=🚀 节点选择,https://raw.githubusercontent.com/juewuy/ShellClash/master/rules/ai.list
|
||||
ruleset=🎯 全球直连,https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/ChinaDomain.list
|
||||
@@ -18,6 +19,7 @@ custom_proxy_group=♻️ 自动选择`url-test`.*`http://www.gstatic.com/genera
|
||||
custom_proxy_group=🔯 故障转移首选`select`.*
|
||||
custom_proxy_group=🔯 故障转移`fallback`[]🔯 故障转移首选`[]👍 高级节点`[]♻️ 自动选择`http://www.gstatic.com/generate_204`180
|
||||
custom_proxy_group=🛑 广告拦截`select`[]DIRECT`[]REJECT
|
||||
custom_proxy_group=🤖 人工智能`select`[]🔯 故障转移`[]🔯 故障转移首选
|
||||
custom_proxy_group=🎥 奈飞解锁`select`[]🎥 流媒体解锁`[]👍 高级节点`[]🔯 故障转移`[]🚀 节点选择
|
||||
custom_proxy_group=🎯 全球直连`select`[]DIRECT`[]🚀 节点选择`[]♻️ 自动选择
|
||||
custom_proxy_group=🐟 漏网之鱼`select`[]🔯 故障转移`[]🚀 节点选择`[]📺 省流节点`[]♻️ 自动选择`[]DIRECT
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
[Unit]
|
||||
Description=clash
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
ExecStartPre=/etc/clash/start.sh bfstart
|
||||
ExecStart=/etc/clash/clash -d /etc/clash >/dev/null
|
||||
ExecStartPost=/etc/clash/start.sh afstart
|
||||
Restart=on-failure
|
||||
RestartSec=3s
|
||||
LimitNOFILE=999999
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
|
||||
SERVICE_DAEMONIZE=1
|
||||
SERVICE_WRITE_PID=1
|
||||
USE_PROCD=1
|
||||
#获取目录
|
||||
DIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
|
||||
[ -z "$DIR" ] && DIR=$(cat ~/.bashrc | grep CRASHDIR | awk -F "\"" '{print $2}')
|
||||
BINDIR=$(cat $DIR/configs/ShellCrash.cfg | grep bindir | awk -F "=" '{print $2}')
|
||||
[ -z "$BINDIR" ] && BINDIR=$DIR
|
||||
|
||||
start_service() {
|
||||
#检测必须文件
|
||||
$DIR/start.sh bfstart
|
||||
if [ "$?" = "0" ];then
|
||||
#使用procd创建clash后台进程
|
||||
procd_open_instance
|
||||
procd_set_param respawn
|
||||
procd_set_param stderr 0
|
||||
procd_set_param stdout 0
|
||||
procd_set_param command $BINDIR/clash -d $BINDIR
|
||||
procd_close_instance
|
||||
#其他设置
|
||||
$DIR/start.sh afstart
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ -z "$(pidof procd)" ];then
|
||||
#检测必须文件
|
||||
$DIR/start.sh bfstart
|
||||
if [ "$?" = "0" ];then
|
||||
#创建后台进程
|
||||
service_start $BINDIR/clash -d $BINDIR
|
||||
#其他设置
|
||||
$DIR/start.sh afstart
|
||||
#设置守护进程
|
||||
$DIR/start.sh daemon
|
||||
fi
|
||||
else
|
||||
start_service
|
||||
fi
|
||||
}
|
||||
1593
scripts/getdate.sh
1593
scripts/getdate.sh
File diff suppressed because it is too large
Load Diff
146
scripts/init.sh
146
scripts/init.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
version=1.8.3c
|
||||
version=1.8.9d
|
||||
|
||||
setdir(){
|
||||
dir_avail(){
|
||||
@@ -119,16 +119,14 @@ if [ ! -w $dir ];then
|
||||
else
|
||||
echo -e "目标目录\033[32m$dir\033[0m空间剩余:$(dir_avail $dir -h)"
|
||||
read -p "确认安装?(1/0) > " res
|
||||
[ "$res" = "1" ] && CRASHDIR=$dir/clash || setdir
|
||||
[ "$res" = "1" ] && CRASHDIR=$dir/ShellCrash || setdir
|
||||
fi
|
||||
}
|
||||
setconfig(){
|
||||
setconfig(){
|
||||
#参数1代表变量名,参数2代表变量值,参数3即文件路径
|
||||
[ -z "$3" ] && configpath=$CRASHDIR/configs/ShellCrash.cfg || configpath=$3
|
||||
[ -n "$(grep -E "^${1}=" $configpath)" ] && sed -i "s#^${1}=\(.*\)#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
|
||||
[ -z "$3" ] && configpath=${CRASHDIR}/configs/ShellCrash.cfg || configpath="${3}"
|
||||
[ -n "$(grep "${1}=" "$configpath")" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
|
||||
}
|
||||
|
||||
$CRASHDIR/start.sh stop 2>/dev/null #防止进程冲突
|
||||
#特殊固件识别及标记
|
||||
[ -f "/etc/storage/started_script.sh" ] && {
|
||||
systype=Padavan #老毛子固件
|
||||
@@ -144,41 +142,62 @@ $CRASHDIR/start.sh stop 2>/dev/null #防止进程冲突
|
||||
|
||||
#检查环境变量
|
||||
[ -z "$CRASHDIR" -a -n "$clashdir" ] && CRASHDIR=$clashdir
|
||||
[ -z "$CRASHDIR" -a -d /tmp/SC_tmp ] && {
|
||||
setdir
|
||||
}
|
||||
[ -z "$CRASHDIR" -a -d /tmp/SC_tmp ] && setdir
|
||||
#移动文件
|
||||
mkdir -p $CRASHDIR
|
||||
mv -f /tmp/SC_tmp/* $CRASHDIR 2>/dev/null
|
||||
mkdir -p ${CRASHDIR}
|
||||
mv -f /tmp/SC_tmp/* ${CRASHDIR} 2>/dev/null
|
||||
|
||||
#初始化
|
||||
mkdir -p $CRASHDIR/configs
|
||||
[ -f "$CRASHDIR/configs/ShellCrash.cfg" ] || echo '#ShellCrash配置文件,不明勿动!' > $CRASHDIR/configs/ShellCrash.cfg
|
||||
#本地安装跳过新手引导
|
||||
#[ -z "$url" ] && setconfig userguide 1
|
||||
mkdir -p ${CRASHDIR}/configs
|
||||
[ -f "${CRASHDIR}/configs/ShellCrash.cfg" ] || echo '#ShellCrash配置文件,不明勿动!' > ${CRASHDIR}/configs/ShellCrash.cfg
|
||||
#判断系统类型写入不同的启动文件
|
||||
if [ -f /etc/rc.common ];then
|
||||
if [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ];then
|
||||
#设为init.d方式启动
|
||||
cp -f $CRASHDIR/clashservice /etc/init.d/clash
|
||||
chmod 755 /etc/init.d/clash
|
||||
cp -f ${CRASHDIR}/shellcrash.procd /etc/init.d/shellcrash
|
||||
chmod 755 /etc/init.d/shellcrash
|
||||
else
|
||||
[ -w /etc/systemd/system ] && sysdir=/etc/systemd/system
|
||||
[ -w /usr/lib/systemd/system ] && sysdir=/usr/lib/systemd/system
|
||||
if [ -n "$sysdir" -a -z "$WSL_DISTRO_NAME" ];then #wsl环境不使用systemd
|
||||
#设为systemd方式启动
|
||||
mv -f $CRASHDIR/clash.service $sysdir/clash.service 2>/dev/null
|
||||
sed -i "s%/etc/clash%$CRASHDIR%g" $sysdir/clash.service
|
||||
[ -w /etc/systemd/system ] && sysdir=/etc/systemd/system
|
||||
if [ -n "$sysdir" -a "$USER" = "root" -a "$(cat /proc/1/comm)" = "systemd" ];then
|
||||
#创建shellcrash用户
|
||||
sed -i '/0:7890/d' /etc/passwd
|
||||
sed -i '/x:7890/d' /etc/group
|
||||
if type useradd &>/dev/null; then
|
||||
useradd shellcrash -u 7890
|
||||
sed -Ei s/7890:7890/0:7890/g /etc/passwd
|
||||
else
|
||||
echo "shellcrash:x:0:7890::/home/shellcrash:/bin/sh" >> /etc/passwd
|
||||
fi
|
||||
#配置systemd
|
||||
mv -f ${CRASHDIR}/shellcrash.service $sysdir/shellcrash.service 2>/dev/null
|
||||
sed -i "s%/etc/ShellCrash%$CRASHDIR%g" $sysdir/shellcrash.service
|
||||
rm -rf $sysdir/clash.service #旧版文件清理
|
||||
systemctl daemon-reload
|
||||
else
|
||||
fi
|
||||
#设为保守模式启动
|
||||
setconfig start_old 已开启
|
||||
fi
|
||||
fi
|
||||
#修饰文件及版本号
|
||||
type bash &>/dev/null && shtype=bash || shtype=sh
|
||||
sed -i "s|/bin/sh|/bin/$shtype|" $CRASHDIR/start.sh
|
||||
chmod 755 $CRASHDIR/start.sh
|
||||
command -v bash &>/dev/null && shtype=bash || shtype=sh
|
||||
for file in start.sh task.sh ;do
|
||||
sed -i "s|/bin/sh|/bin/$shtype|" ${CRASHDIR}/${file}
|
||||
chmod 755 ${CRASHDIR}/${file}
|
||||
done
|
||||
setconfig versionsh_l $version
|
||||
#生成用于执行systemd及procd服务的变量文件
|
||||
[ ! -f ${CRASHDIR}/configs/command.env ] && {
|
||||
TMPDIR='/tmp/ShellCrash'
|
||||
BINDIR=${CRASHDIR}
|
||||
touch ${CRASHDIR}/configs/command.env
|
||||
setconfig TMPDIR ${TMPDIR} ${CRASHDIR}/configs/command.env
|
||||
setconfig BINDIR ${BINDIR} ${CRASHDIR}/configs/command.env
|
||||
}
|
||||
if [ -x ${CRASHDIR}/CrashCore ] && [ -n "$(grep 'crashcore=singbox' ${CRASHDIR}/configs/ShellCrash.cfg)" ];then
|
||||
COMMAND='"$BINDIR/CrashCore run -D $BINDIR -C $TMPDIR/jsons"'
|
||||
else
|
||||
COMMAND='"$BINDIR/CrashCore -d $BINDIR -f $TMPDIR/config.yaml"'
|
||||
fi
|
||||
setconfig COMMAND "$COMMAND" ${CRASHDIR}/configs/command.env
|
||||
#设置更新地址
|
||||
[ -n "$url" ] && setconfig update_url $url
|
||||
#设置环境变量
|
||||
@@ -188,13 +207,20 @@ setconfig versionsh_l $version
|
||||
[ -w /etc/profile ] && profile=/etc/profile
|
||||
if [ -n "$profile" ];then
|
||||
sed -i '/alias crash=*/'d $profile
|
||||
echo "alias crash=\"$shtype $CRASHDIR/clash.sh\"" >> $profile #设置快捷命令环境变量
|
||||
echo "alias crash=\"$shtype $CRASHDIR/menu.sh\"" >> $profile #设置快捷命令环境变量
|
||||
sed -i '/alias clash=*/'d $profile
|
||||
echo "alias clash=\"$shtype $CRASHDIR/menu.sh\"" >> $profile #设置快捷命令环境变量
|
||||
sed -i '/export CRASHDIR=*/'d $profile
|
||||
echo "export CRASHDIR=\"$CRASHDIR\"" >> $profile #设置clash路径环境变量
|
||||
echo "export CRASHDIR=\"$CRASHDIR\"" >> $profile #设置路径环境变量
|
||||
source $profile &>/dev/null || echo 运行错误!请使用bash而不是dash运行安装命令!!!
|
||||
#适配zsh环境变量
|
||||
[ -n "$(ls -l /bin/sh|grep -oE 'zsh')" ] && [ -z "$(cat ~/.zshrc 2>/dev/null|grep CRASHDIR)" ] && {
|
||||
echo "alias crash=\"$shtype $CRASHDIR/clash.sh\"" >> ~/.zshrc
|
||||
[ -n "$(cat /etc/shells 2>/dev/null|grep -oE 'zsh')" ] && [ -z "$(cat ~/.zshrc 2>/dev/null|grep CRASHDIR)" ] && {
|
||||
sed -i '/alias crash=*/'d ~/.zshrc
|
||||
echo "alias crash=\"$shtype $CRASHDIR/menu.sh\"" >> ~/.zshrc
|
||||
# 兼容 clash 命令
|
||||
sed -i '/alias clash=*/'d ~/.zshrc
|
||||
echo "alias clash=\"$shtype $CRASHDIR/menu.sh\"" >> ~/.zshrc
|
||||
sed -i '/export CRASHDIR=*/'d ~/.zshrc
|
||||
echo "export CRASHDIR=\"$CRASHDIR\"" >> ~/.zshrc
|
||||
source ~/.zshrc &>/dev/null
|
||||
}
|
||||
@@ -212,7 +238,7 @@ fi
|
||||
}
|
||||
#镜像化OpenWrt(snapshot)额外设置
|
||||
if [ "$systype" = "mi_snapshot" -o "$systype" = "ng_snapshot" ];then
|
||||
chmod 755 $CRASHDIR/misnap_init.sh
|
||||
chmod 755 ${CRASHDIR}/misnap_init.sh
|
||||
uci delete firewall.ShellClash 2>/dev/null
|
||||
uci delete firewall.ShellCrash 2>/dev/null
|
||||
uci set firewall.ShellCrash=include
|
||||
@@ -222,44 +248,54 @@ if [ "$systype" = "mi_snapshot" -o "$systype" = "ng_snapshot" ];then
|
||||
uci commit firewall
|
||||
setconfig systype $systype
|
||||
else
|
||||
rm -rf $CRASHDIR/misnap_init.sh
|
||||
rm -rf ${CRASHDIR}/misnap_init.sh
|
||||
fi
|
||||
#华硕USB启动额外设置
|
||||
[ "$usb_status" = "1" ] && {
|
||||
echo "$CRASHDIR/start.sh init #ShellCrash初始化脚本" > $CRASHDIR/asus_usb_mount.sh
|
||||
echo "$CRASHDIR/start.sh init #ShellCrash初始化脚本" > ${CRASHDIR}/asus_usb_mount.sh
|
||||
nvram set script_usbmount="$CRASHDIR/asus_usb_mount.sh"
|
||||
nvram commit
|
||||
}
|
||||
#删除临时文件
|
||||
rm -rf /tmp/*lash*gz
|
||||
rm -rf /tmp/*rash*gz
|
||||
rm -rf /tmp/SC_tmp
|
||||
#转换&清理旧版本文件
|
||||
mkdir -p $CRASHDIR/yamls
|
||||
mkdir -p $CRASHDIR/tools
|
||||
mkdir -p $CRASHDIR/task
|
||||
mkdir -p ${CRASHDIR}/yamls
|
||||
mkdir -p ${CRASHDIR}/jsons
|
||||
mkdir -p ${CRASHDIR}/tools
|
||||
mkdir -p ${CRASHDIR}/task
|
||||
for file in config.yaml.bak user.yaml proxies.yaml proxy-groups.yaml rules.yaml others.yaml ;do
|
||||
mv -f $CRASHDIR/$file $CRASHDIR/yamls/$file 2>/dev/null
|
||||
mv -f ${CRASHDIR}/$file ${CRASHDIR}/yamls/$file 2>/dev/null
|
||||
done
|
||||
[ ! -L $CRASHDIR/config.yaml ] && mv -f $CRASHDIR/config.yaml $CRASHDIR/yamls/config.yaml 2>/dev/null
|
||||
[ ! -L ${CRASHDIR}/config.yaml ] && mv -f ${CRASHDIR}/config.yaml ${CRASHDIR}/yamls/config.yaml 2>/dev/null
|
||||
for file in fake_ip_filter mac web_save servers.list fake_ip_filter.list fallback_filter.list;do
|
||||
mv -f $CRASHDIR/$file $CRASHDIR/configs/$file 2>/dev/null
|
||||
mv -f ${CRASHDIR}/$file ${CRASHDIR}/configs/$file 2>/dev/null
|
||||
done
|
||||
#配置文件改名
|
||||
mv -f $CRASHDIR/mark $CRASHDIR/configs/ShellCrash.cfg 2>/dev/null
|
||||
mv -f $CRASHDIR/configs/ShellClash.cfg $CRASHDIR/configs/ShellCrash.cfg 2>/dev/null
|
||||
mv -f ${CRASHDIR}/mark ${CRASHDIR}/configs/ShellCrash.cfg 2>/dev/null
|
||||
mv -f ${CRASHDIR}/configs/ShellClash.cfg ${CRASHDIR}/configs/ShellCrash.cfg 2>/dev/null
|
||||
#内核改名
|
||||
mv -f ${CRASHDIR}/clash ${CRASHDIR}/CrashCore 2>/dev/null
|
||||
for file in dropbear_rsa_host_key authorized_keys tun.ko ShellDDNS.sh;do
|
||||
mv -f $CRASHDIR/$file $CRASHDIR/tools/$file 2>/dev/null
|
||||
mv -f ${CRASHDIR}/$file ${CRASHDIR}/tools/$file 2>/dev/null
|
||||
done
|
||||
for file in cron task.sh task.list;do
|
||||
mv -f $CRASHDIR/$file $CRASHDIR/task/$file 2>/dev/null
|
||||
mv -f ${CRASHDIR}/$file ${CRASHDIR}/task/$file 2>/dev/null
|
||||
done
|
||||
chmod 755 $CRASHDIR/task/task.sh
|
||||
for file in log clash.service mark? mark.bak;do
|
||||
rm -rf $CRASHDIR/$file
|
||||
chmod 755 ${CRASHDIR}/task/task.sh
|
||||
#旧版文件清理
|
||||
userdel shellclash &>/dev/null
|
||||
sed -i '/shellclash/d' /etc/passwd
|
||||
sed -i '/shellclash/d' /etc/group
|
||||
rm -rf /etc/init.d/clash
|
||||
[ "$systype" = "mi_snapshot" -a "$CRASHDIR" != '/data/clash' ] && rm -rf /data/clash
|
||||
for file in clash.sh shellcrash.rc core.new clashservice log shellcrash.service mark? mark.bak;do
|
||||
rm -rf ${CRASHDIR}/$file
|
||||
done
|
||||
#旧版任务清理
|
||||
$CRASHDIR/start.sh cronset "clash服务" 2>/dev/null
|
||||
$CRASHDIR/start.sh cronset "订阅链接" 2>/dev/null
|
||||
$CRASHDIR/start.sh cronset "ShellCrash初始化" 2>/dev/null
|
||||
sleep 1
|
||||
#旧版变量改名
|
||||
sed -i "s/clashcore/crashcore/g" $configpath
|
||||
sed -i "s/clash_v/core_v/g" $configpath
|
||||
sed -i "s/clash.meta/meta/g" $configpath
|
||||
sed -i "s/ShellClash/ShellCrash/g" $configpath
|
||||
|
||||
echo -e "\033[32m脚本初始化完成,请输入\033[30;47m crash \033[0;33m命令开始使用!\033[0m"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -51,14 +51,16 @@ init(){
|
||||
done
|
||||
#初始化环境变量
|
||||
sed -i "/alias crash/d" $profile
|
||||
sed -i "/alias clash/d" $profile
|
||||
sed -i "/export CRASHDIR/d" $profile
|
||||
echo "alias crash=\"$CRASHDIR/clash.sh\"" >>$profile
|
||||
echo "alias crash=\"sh $CRASHDIR/menu.sh\"" >>$profile
|
||||
echo "alias clash=\"sh $CRASHDIR/menu.sh\"" >>$profile
|
||||
echo "export CRASHDIR=\"$CRASHDIR\"" >>$profile
|
||||
#软固化功能
|
||||
autoSSH
|
||||
#设置init.d服务
|
||||
cp -f $CRASHDIR/clashservice /etc/init.d/clash
|
||||
chmod 755 /etc/init.d/clash
|
||||
cp -f $CRASHDIR/shellcrash.procd /etc/init.d/shellcrash
|
||||
chmod 755 /etc/init.d/shellcrash
|
||||
#启动服务
|
||||
if [ ! -f $CRASHDIR/.dis_startup ]; then
|
||||
#AX6S/AX6000修复tun功能
|
||||
@@ -66,8 +68,8 @@ init(){
|
||||
#小米7000/小米万兆修复tproxy
|
||||
[ -f /etc/init.d/qca-nss-ecm ] && [ -n "$(grep 'redir_mod=Tproxy' $CRASHDIR/configs/ShellCrash.cfg )" ] && tproxyfix
|
||||
#启动服务
|
||||
/etc/init.d/clash start
|
||||
/etc/init.d/clash enable
|
||||
/etc/init.d/shellcrash start
|
||||
/etc/init.d/shellcrash enable
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -76,7 +78,7 @@ case "$1" in
|
||||
tproxyfix) tproxyfix ;;
|
||||
init) init ;;
|
||||
*)
|
||||
if [ -z $(pidof clash) ];then
|
||||
if [ -z $(pidof CrashCore) ];then
|
||||
init &
|
||||
fi
|
||||
;;
|
||||
|
||||
35
scripts/shellcrash.procd
Normal file
35
scripts/shellcrash.procd
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
|
||||
SERVICE_DAEMONIZE=1
|
||||
SERVICE_WRITE_PID=1
|
||||
USE_PROCD=1
|
||||
#获取目录
|
||||
CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
|
||||
[ -z "$CRASHDIR" ] && CRASHDIR=$(cat ~/.bashrc | grep CRASHDIR | awk -F "\"" '{print $2}')
|
||||
source ${CRASHDIR}/configs/command.env #加载启动命令和启动目录
|
||||
|
||||
start_service() {
|
||||
#检测必须文件
|
||||
$CRASHDIR/start.sh bfstart
|
||||
#本机代理用户
|
||||
[ -n "$(grep -E 'local_type.*增强模式' ${CRASHDIR}/configs/ShellCrash.cfg)" ] && USER=shellcrash || USER=root
|
||||
if [ "$?" = "0" ];then
|
||||
#使用procd创建clash后台进程
|
||||
procd_open_instance
|
||||
procd_set_param user $USER
|
||||
procd_set_param respawn
|
||||
procd_set_param command $COMMAND
|
||||
procd_set_param stderr 0
|
||||
procd_set_param stdout 0
|
||||
procd_close_instance
|
||||
#启动结束执行
|
||||
$CRASHDIR/start.sh afstart
|
||||
fi
|
||||
}
|
||||
stop_service(){
|
||||
procd_close_instance
|
||||
$CRASHDIR/start.sh stop_firewall
|
||||
$CRASHDIR/start.sh unset_proxy
|
||||
}
|
||||
17
scripts/shellcrash.service
Normal file
17
scripts/shellcrash.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=ShellCrash Core
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=shellcrash
|
||||
ExecStart=/etc/ShellCrash/CrashCore run -D /etc/ShellCrash -C /tmp/ShellCrash/jsons
|
||||
ExecStartPost=/etc/ShellCrash/start.sh afstart >/dev/null &
|
||||
ExecStopPost=/etc/ShellCrash/start.sh stop_firewall ; /etc/ShellCrash/start.sh unset_proxy
|
||||
Restart=on-abnormal
|
||||
RestartSec=10s
|
||||
LimitNOFILE=infinity
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
1755
scripts/start.sh
1755
scripts/start.sh
File diff suppressed because it is too large
Load Diff
268
scripts/task.sh
268
scripts/task.sh
@@ -2,80 +2,86 @@
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
#加载全局变量
|
||||
[ -d "/etc/storage/clash" ] && CRASHDIR=/etc/storage/clash
|
||||
[ -d "/jffs/clash" ] && CRASHDIR=/jffs/clash
|
||||
[ -z "$CRASHDIR" ] && CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
|
||||
[ -z "$CRASHDIR" ] && CRASHDIR=$(cat ~/.bashrc | grep CRASHDIR | awk -F "\"" '{print $2}')
|
||||
[ -z "$bindir" ] && bindir=$CRASHDIR
|
||||
CFG_PATH=$CRASHDIR/configs/ShellCrash.cfg
|
||||
TMPDIR=/tmp/ShellCrash && [ ! -f $TMPDIR ] && mkdir -p $TMPDIR
|
||||
[ -z "$CRASHDIR" ] && CRASHDIR=$(cd "$(dirname "$(dirname "$0")")"; pwd)
|
||||
[ -z "$BINDIR" ] && BINDIR=${CRASHDIR}
|
||||
CFG_PATH=${CRASHDIR}/configs/ShellCrash.cfg
|
||||
TMPDIR=/tmp/ShellCrash && [ ! -f ${TMPDIR} ] && mkdir -p ${TMPDIR}
|
||||
source $CFG_PATH &> /dev/null
|
||||
|
||||
setconfig(){
|
||||
#参数1代表变量名,参数2代表变量值,参数3即文件路径
|
||||
[ -z "$3" ] && configpath=$CFG_PATH || configpath=$3
|
||||
[ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
|
||||
}
|
||||
ckcmd(){ #检查命令是否存在
|
||||
command -v sh &>/dev/null && command -v $1 &>/dev/null || type $1 &>/dev/null
|
||||
}
|
||||
|
||||
#任务命令
|
||||
check_update(){ #检查更新工具
|
||||
$CRASHDIR/start.sh webget $TMPDIR/clashversion "$update_url/bin/version" echooff
|
||||
[ "$?" = "0" ] && source $TMPDIR/clashversion 2>/dev/null
|
||||
rm -rf $TMPDIR/clashversion
|
||||
${CRASHDIR}/start.sh get_bin ${TMPDIR}/crashversion "bin/version" echooff
|
||||
[ "$?" = "0" ] && source ${TMPDIR}/crashversion 2>/dev/null
|
||||
rm -rf ${TMPDIR}/crashversion
|
||||
}
|
||||
update_core(){ #自动更新内核
|
||||
#检查版本
|
||||
check_update
|
||||
clash_v_new=$(eval echo \$${clashcore}_v)
|
||||
clash_v_now=$($bindir/clash -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')
|
||||
if [ -z "$clash_v_new" -o "$clash_v_new" = "clash_v_now" ];then
|
||||
crash_v_new=$(eval echo \$${crashcore}_v)
|
||||
if [ -z "$crash_v_new" -o "$crash_v_new" = "core_v" ];then
|
||||
logger "任务【自动更新内核】中止-未检测到版本更新"
|
||||
exit 1
|
||||
else
|
||||
#更新内核
|
||||
$CRASHDIR/start.sh webget $TMPDIR/clash.new "$update_url/bin/$clashcore/clash-linux-$cpucore"
|
||||
[ "$crashcore" = singbox ] && core_new=singbox || core_new=clash
|
||||
${CRASHDIR}/start.sh get_bin ${TMPDIR}/core.new "bin/${crashcore}/${core_new}-linux-${cpucore}"
|
||||
if [ "$?" != "0" ];then
|
||||
logger "任务【自动更新内核】出错-下载失败!"
|
||||
rm -rf $TMPDIR/clash.new
|
||||
rm -rf ${TMPDIR}/core.new
|
||||
return 1
|
||||
else
|
||||
chmod +x $TMPDIR/clash.new
|
||||
$CRASHDIR/start.sh stop
|
||||
clashv=$($TMPDIR/clash.new -v 2>/dev/null | sed 's/ linux.*//;s/.* //')
|
||||
if [ -z "$clashv" ];then
|
||||
logger "任务【自动更新内核】出错-下载失败!"
|
||||
rm -rf $TMPDIR/clash.new
|
||||
[ $clashcore = meta ] && $CRASHDIR/start.sh start
|
||||
chmod +x ${TMPDIR}/core.new
|
||||
${CRASHDIR}/start.sh stop
|
||||
if [ "$crashcore" = singbox ];then
|
||||
core_v=$(${TMPDIR}/core.new version 2>/dev/null | grep version | awk '{print $3}')
|
||||
else
|
||||
core_v=$(${TMPDIR}/core.new -v 2>/dev/null | sed 's/ linux.*//;s/.* //')
|
||||
fi
|
||||
if [ -z "$core_v" ];then
|
||||
logger "任务【自动更新内核】出错-内核校验失败!"
|
||||
rm -rf ${TMPDIR}/core.new
|
||||
${CRASHDIR}/start.sh start
|
||||
return 1
|
||||
else
|
||||
mv -f $TMPDIR/clash.new $bindir/clash
|
||||
mv -f ${TMPDIR}/core.new ${BINDIR}/CrashCore
|
||||
logger "任务【自动更新内核】下载完成,正在重启服务!"
|
||||
$CRASHDIR/start.sh start
|
||||
setconfig core_v $core_v
|
||||
${CRASHDIR}/start.sh start
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
update_shellclash(){ #自动更新脚本
|
||||
update_shellcrash(){ #自动更新脚本
|
||||
#检查版本
|
||||
check_update
|
||||
if [ -z "$versionsh" -o "$versionsh" = "versionsh_l" ];then
|
||||
logger "任务【自动更新脚本】中止-未检测到版本更新"
|
||||
exit 1
|
||||
else
|
||||
$CRASHDIR/start.sh webget $TMPDIR/clashfm.tar.gz "$update_url/bin/clashfm.tar.gz"
|
||||
${CRASHDIR}/start.sh get_bin ${TMPDIR}/update.tar.gz "bin/update.tar.gz"
|
||||
if [ "$?" != "0" ];then
|
||||
rm -rf $TMPDIR/clashfm.tar.gz
|
||||
rm -rf ${TMPDIR}/update.tar.gz
|
||||
logger "任务【自动更新内核】出错-下载失败!"
|
||||
return 1
|
||||
else
|
||||
#解压
|
||||
tar -zxvf "$TMPDIR/clashfm.tar.gz" -C $CRASHDIR/ || tar -zxvf "$TMPDIR/clashfm.tar.gz" --no-same-owner -C $CRASHDIR/
|
||||
tar -zxvf "${TMPDIR}/update.tar.gz" -C ${CRASHDIR}/ || tar -zxvf "${TMPDIR}/update.tar.gz" --no-same-owner -C ${CRASHDIR}/
|
||||
if [ $? -ne 0 ];then
|
||||
rm -rf $TMPDIR/clashfm.tar.gz
|
||||
rm -rf ${TMPDIR}/update.tar.gz
|
||||
logger "任务【自动更新内核】出错-解压失败!"
|
||||
return 1
|
||||
else
|
||||
source $CRASHDIR/init.sh >/dev/null
|
||||
source ${CRASHDIR}/init.sh >/dev/null
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
@@ -92,13 +98,13 @@ update_mmdb(){ #自动更新数据库
|
||||
logger "任务【自动更新数据库文件】跳过-未检测到$2版本更新"
|
||||
else
|
||||
#更新文件
|
||||
$CRASHDIR/start.sh webget $TMPDIR/$1 "$update_url/bin/geodata/$2"
|
||||
${CRASHDIR}/start.sh get_bin ${TMPDIR}/$1 "bin/geodata/$2"
|
||||
if [ "$?" != "0" ];then
|
||||
logger "任务【自动更新数据库文件】更新【$2】下载失败!"
|
||||
rm -rf $TMPDIR/$1
|
||||
rm -rf ${TMPDIR}/$1
|
||||
return 1
|
||||
else
|
||||
mv -f $TMPDIR/$1 $bindir/$1
|
||||
mv -f ${TMPDIR}/$1 ${BINDIR}/$1
|
||||
setconfig $geo_v $GeoIP_v
|
||||
logger "任务【自动更新数据库文件】更新【$2】成功!"
|
||||
return 0
|
||||
@@ -110,10 +116,15 @@ update_mmdb(){ #自动更新数据库
|
||||
[ -n "${china_ip_list_v}" ] && getgeo cn_ip.txt china_ip_list.txt
|
||||
[ -n "${china_ipv6_list_v}" ] && getgeo cn_ipv6.txt china_ipv6_list.txt
|
||||
[ -n "${geosite_v}" ] && getgeo GeoSite.dat geosite.dat
|
||||
[ -n "${geoip_cn_v}" ] && getgeo geoip.db geoip_cn.db
|
||||
[ -n "${geosite_cn_v}" ] && getgeo geosite.db geosite_cn.db
|
||||
}
|
||||
reset_firewall(){ #重设透明路由防火墙
|
||||
$CRASHDIR/start.sh stop_firewall
|
||||
$CRASHDIR/start.sh afstart
|
||||
${CRASHDIR}/start.sh stop_firewall
|
||||
${CRASHDIR}/start.sh afstart
|
||||
}
|
||||
ntp(){
|
||||
[ "$crashcore" != singbox ] && ckcmd ntpd && ntpd -n -q -p 203.107.6.88 &>/dev/null || exit 0 &
|
||||
}
|
||||
#任务工具
|
||||
|
||||
@@ -121,7 +132,7 @@ logger(){
|
||||
[ "$task_push" = 1 ] && push= || push=off
|
||||
[ -n "$2" -a "$2" != 0 ] && echo -e "\033[$2m$1\033[0m"
|
||||
[ "$3" = 'off' ] && push=off
|
||||
$CRASHDIR/start.sh logger $1 0 $push
|
||||
${CRASHDIR}/start.sh logger $1 0 $push
|
||||
}
|
||||
croncmd(){
|
||||
if [ -n "$(crontab -h 2>&1 | grep '\-l')" ];then
|
||||
@@ -131,21 +142,24 @@ croncmd(){
|
||||
[ ! -w "$crondir" ] && crondir="/etc/storage/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron/crontabs"
|
||||
[ ! -w "$crondir" ] && crondir="/var/spool/cron"
|
||||
[ ! -w "$crondir" ] && echo "你的设备不支持定时任务配置,脚本大量功能无法启用,请前往 https://t.me/ShellCrash 申请适配!"
|
||||
[ "$1" = "-l" ] && cat $crondir/$USER 2>/dev/null
|
||||
[ -f "$1" ] && cat $1 > $crondir/$USER
|
||||
if [ -w "$crondir" ];then
|
||||
[ "$1" = "-l" ] && cat $crondir/$USER 2>/dev/null
|
||||
[ -f "$1" ] && cat $1 > $crondir/$USER
|
||||
else
|
||||
echo "你的设备不支持定时任务配置,脚本大量功能无法启用,请尝试使用搜索引擎查找安装方式!"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
cronset(){
|
||||
# 参数1代表要移除的关键字,参数2代表要添加的任务语句
|
||||
tmpcron=$TMPDIR/cron_$USER
|
||||
croncmd -l > $tmpcron
|
||||
tmpcron=${TMPDIR}/cron_$USER
|
||||
croncmd -l > $tmpcron 2>/dev/null
|
||||
sed -i "/$1/d" $tmpcron
|
||||
sed -i '/^$/d' $tmpcron
|
||||
echo "$2" >> $tmpcron
|
||||
croncmd $tmpcron
|
||||
#华硕/Padavan固件存档在本地,其他则删除
|
||||
[ "$CRASHDIR" = "/jffs/clash" -o "$CRASHDIR" = "/etc/storage/clash" ] && mv -f $tmpcron $CRASHDIR/task/cron || rm -f $tmpcron
|
||||
[ -d /jffs -o -d /etc/storage/clash -o -d /etc/storage/ShellCrash ] && mv -f $tmpcron ${CRASHDIR}/task/cron || rm -f $tmpcron
|
||||
}
|
||||
set_cron(){
|
||||
[ -z $week ] && week=*
|
||||
@@ -157,20 +171,20 @@ set_cron(){
|
||||
if [ "$res" = '1' ]; then
|
||||
task_txt="$min $hour * * $week $CRASHDIR/task/task.sh $task_id $cron_time$task_name"
|
||||
cronset "$cron_time$task_name" "$task_txt"
|
||||
echo -e "任务【$cron_time$task_name】\033[32m已添加!\033[0m"
|
||||
fi
|
||||
unset week hour min
|
||||
echo -e "任务【$cron_time$task_name】\033[32m添加成功!\033[0m"
|
||||
sleep 1
|
||||
}
|
||||
set_service(){
|
||||
# 参数1代表要任务类型,参数2代表任务ID,参数3代表任务描述,参数4代表running任务cron时间
|
||||
task_file=$CRASHDIR/task/$1
|
||||
task_file=${CRASHDIR}/task/$1
|
||||
[ -s $task_file ] && sed -i "/$3/d" $task_file
|
||||
#运行时每分钟执行的任务特殊处理
|
||||
if [ "$1" = "running" ];then
|
||||
task_txt="$4 $CRASHDIR/task/task.sh $2 $3"
|
||||
echo "$task_txt" >> $task_file
|
||||
[ -n "$(pidof clash)" ] && cronset "$3" "$task_txt"
|
||||
[ -n "$(pidof CrashCore)" ] && cronset "$3" "$task_txt"
|
||||
else
|
||||
echo "$CRASHDIR/task/task.sh $2 $3" >> $task_file
|
||||
fi
|
||||
@@ -181,18 +195,18 @@ set_service(){
|
||||
task_user_add(){ #自定义命令添加
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m命令可包含空格,请确保命令可执行!\033[0m"
|
||||
echo -e "也可以手动编辑\033[32m$CRASHDIR/task/task.user\033[0m添加"
|
||||
echo -e "也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m添加"
|
||||
read -p "请输入命令语句 > " script
|
||||
if [ -n "$script" ];then
|
||||
task_command=$script
|
||||
echo -e "请检查输入:\033[32m$task_command\033[0m"
|
||||
#获取本任务ID
|
||||
task_max_id=$(awk -F'#' '{print $1}' $CRASHDIR/task/task.user | sort -n | tail -n 1)
|
||||
task_max_id=$(awk -F '#' '{print $1}' ${CRASHDIR}/task/task.user 2>/dev/null | sort -n | tail -n 1)
|
||||
[ -z "$task_max_id" ] && task_max_id=200
|
||||
task_id=$((task_max_id + 1))
|
||||
read -p "请输入任务备注 > " txt
|
||||
[ -n "$txt" ] && task_name=$txt || task_name=自定义任务$task_id
|
||||
echo "$task_id#$task_command#$task_name" >> $CRASHDIR/task/task.user
|
||||
echo "$task_id#$task_command#$task_name" >> ${CRASHDIR}/task/task.user
|
||||
echo -e "\033[32m自定义任务已添加!\033[0m"
|
||||
sleep 1
|
||||
else
|
||||
@@ -203,15 +217,15 @@ task_user_add(){ #自定义命令添加
|
||||
task_user_del(){ #自定义命令删除
|
||||
echo -----------------------------------------------
|
||||
echo -e "请输入对应ID移除对应自定义任务(不会影响内置任务)"
|
||||
echo -e "也可以手动编辑\033[32m$CRASHDIR/task/task.user\033[0m"
|
||||
echo -e "也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m"
|
||||
echo -----------------------------------------------
|
||||
cat $CRASHDIR/task/task.user 2>/dev/null | grep -Ev '^#' | awk -F '#' '{print $1" "$3}'
|
||||
cat ${CRASHDIR}/task/task.user 2>/dev/null | grep -Ev '^#' | awk -F '#' '{print $1" "$3}'
|
||||
echo -----------------------------------------------
|
||||
echo 0 返回上级菜单
|
||||
echo -----------------------------------------------
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -n "$num" ];then
|
||||
sed -i "/^$num#/d" $CRASHDIR/task/task.user 2>/dev/null
|
||||
sed -i "/^$num#/d" ${CRASHDIR}/task/task.user 2>/dev/null
|
||||
[ "$num" != 0 ] && task_user_del
|
||||
else
|
||||
echo -e "\033[31m输入错误,请重新输入!\033[0m"
|
||||
@@ -222,10 +236,8 @@ task_add(){ #任务添加
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[36m请选择需要添加的任务\033[0m"
|
||||
echo -----------------------------------------------
|
||||
#检测并创建自定义任务文件
|
||||
[ -f $CRASHDIR/task/task.user ] || echo '#任务ID(必须>200并顺序排列)#任务命令#任务说明(#号隔开,任务命令和说明中都不允许包含#号)' > $CRASHDIR/task/task.user
|
||||
#输出任务列表
|
||||
cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | awk -F '#' '{print " "NR" "$3}'
|
||||
cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | awk -F '#' '{print " "NR" "$3}'
|
||||
echo -----------------------------------------------
|
||||
echo -e " 0 返回上级菜单"
|
||||
read -p "请输入对应数字 > " num
|
||||
@@ -233,9 +245,9 @@ task_add(){ #任务添加
|
||||
0)
|
||||
;;
|
||||
[1-9]|[1-9][0-9])
|
||||
if [ "$num" -le "$(cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | wc -l)" ];then
|
||||
task_id=$(cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $1}')
|
||||
task_name=$(cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $3}')
|
||||
if [ "$num" -le "$(cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | wc -l)" ];then
|
||||
task_id=$(cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $1}')
|
||||
task_name=$(cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $3}')
|
||||
task_type
|
||||
else
|
||||
errornum
|
||||
@@ -248,14 +260,14 @@ task_add(){ #任务添加
|
||||
}
|
||||
task_del(){ #任务删除
|
||||
#删除定时任务
|
||||
croncmd -l > $TMPDIR/cron && sed -i "/$1/d" $TMPDIR/cron && croncmd $TMPDIR/cron
|
||||
rm -f $TMPDIR/cron
|
||||
croncmd -l > ${TMPDIR}/cron && sed -i "/$1/d" ${TMPDIR}/cron && croncmd ${TMPDIR}/cron
|
||||
rm -f ${TMPDIR}/cron
|
||||
#删除条件任务
|
||||
sed -i "/$1/d" $CRASHDIR/task/cron 2>/dev/null
|
||||
sed -i "/$1/d" $CRASHDIR/task/bfstart 2>/dev/null
|
||||
sed -i "/$1/d" $CRASHDIR/task/afstart 2>/dev/null
|
||||
sed -i "/$1/d" $CRASHDIR/task/running 2>/dev/null
|
||||
sed -i "/$1/d" $CRASHDIR/task/affirewall 2>/dev/null
|
||||
sed -i "/$1/d" ${CRASHDIR}/task/cron 2>/dev/null
|
||||
sed -i "/$1/d" ${CRASHDIR}/task/bfstart 2>/dev/null
|
||||
sed -i "/$1/d" ${CRASHDIR}/task/afstart 2>/dev/null
|
||||
sed -i "/$1/d" ${CRASHDIR}/task/running 2>/dev/null
|
||||
sed -i "/$1/d" ${CRASHDIR}/task/affirewall 2>/dev/null
|
||||
}
|
||||
task_type(){ #任务条件选择菜单
|
||||
echo -----------------------------------------------
|
||||
@@ -294,7 +306,7 @@ task_type(){ #任务条件选择菜单
|
||||
echo -e " 输入 6-18 代表\033[36m早6点至晚18点间每小时\033[0m运行"
|
||||
read -p "想在每日的具体哪个小时执行?(0-23) > " hour
|
||||
echo -----------------------------------------------
|
||||
read -p "想在具体哪分钟执行?(1-59的整数) > " min
|
||||
read -p "想在具体哪分钟执行?(0-59的整数) > " min
|
||||
cron_time="在每日的$hour点$min分"
|
||||
set_cron
|
||||
;;
|
||||
@@ -348,25 +360,32 @@ task_type(){ #任务条件选择菜单
|
||||
task_manager(){ #任务管理列表
|
||||
echo -----------------------------------------------
|
||||
#抽取并生成临时列表
|
||||
croncmd -l > $TMPDIR/task_cronlist
|
||||
cat $TMPDIR/task_cronlist $CRASHDIR/task/running 2>/dev/null | sort -u | grep -oE "task/task.sh .*" | awk -F ' ' '{print $2" "$3}' > $TMPDIR/task_list
|
||||
cat $CRASHDIR/task/bfstart $CRASHDIR/task/afstart $CRASHDIR/task/affirewall 2>/dev/null | awk -F ' ' '{print $2" "$3}' >> $TMPDIR/task_list
|
||||
rm -rf $TMPDIR/task_cronlist
|
||||
croncmd -l > ${TMPDIR}/task_cronlist
|
||||
cat ${TMPDIR}/task_cronlist ${CRASHDIR}/task/running 2>/dev/null | sort -u | grep -oE "task/task.sh .*" | awk -F ' ' '{print $2" "$3}' > ${TMPDIR}/task_list
|
||||
cat ${CRASHDIR}/task/bfstart ${CRASHDIR}/task/afstart ${CRASHDIR}/task/affirewall 2>/dev/null | awk -F ' ' '{print $2" "$3}' >> ${TMPDIR}/task_list
|
||||
cat ${TMPDIR}/task_cronlist 2>/dev/null | sort -u | grep -oE " #.*" | grep -v "守护" | awk -F '#' '{print "0 旧版任务-"$2}' >> ${TMPDIR}/task_list
|
||||
rm -rf ${TMPDIR}/task_cronlist
|
||||
#判断为空则返回
|
||||
if [ ! -s $TMPDIR/task_list ];then
|
||||
if [ ! -s ${TMPDIR}/task_list ];then
|
||||
echo -e "\033[31m当前没有可供管理的任务!\033[36m"
|
||||
sleep 1
|
||||
else
|
||||
echo -e "\033[33m已添加的任务:\033[0m"
|
||||
echo -----------------------------------------------
|
||||
cat $TMPDIR/task_list | awk '{print " " NR " " $2}'
|
||||
cat ${TMPDIR}/task_list | awk '{print " " NR " " $2}'
|
||||
echo -----------------------------------------------
|
||||
echo -e " d 清空任务列表"
|
||||
echo -e " a 清空旧版任务"
|
||||
echo -e " d 清空任务列表"
|
||||
echo -e " 0 返回上级菜单"
|
||||
read -p "请输入对应数字 > " num
|
||||
case "$num" in
|
||||
0)
|
||||
;;
|
||||
a)
|
||||
task_del "#"
|
||||
echo -e "\033[31m旧版任务已清空!\033[36m"
|
||||
sleep 1
|
||||
;;
|
||||
d)
|
||||
task_del "task.sh"
|
||||
echo -e "\033[31m全部任务已清空!\033[36m"
|
||||
@@ -374,48 +393,57 @@ task_manager(){ #任务管理列表
|
||||
;;
|
||||
[1-9]|[1-9][0-9])
|
||||
|
||||
task_txt=$(sed -n "$num p" $TMPDIR/task_list)
|
||||
task_txt=$(sed -n "$num p" ${TMPDIR}/task_list)
|
||||
task_id=$(echo $task_txt | awk '{print $1}')
|
||||
task_des=$(echo $task_txt | awk '{print $2}')
|
||||
task_name=$(cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $3}')
|
||||
echo -----------------------------------------------
|
||||
echo -e "当前任务为:\033[36m $task_des\033[0m"
|
||||
echo -e " 1 \033[33m修改\033[0m当前任务"
|
||||
echo -e " 2 \033[31m删除\033[0m当前任务"
|
||||
echo -e " 3 \033[32m立即执行\033[0m一次"
|
||||
echo -e " 4 查看\033[33m执行记录\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 0 返回上级菜单"
|
||||
read -p "请选择需要执行的操作 > " num
|
||||
case "$num" in
|
||||
0)
|
||||
;;
|
||||
1)
|
||||
task_type && task_del $task_des
|
||||
;;
|
||||
2)
|
||||
task_del $task_des
|
||||
;;
|
||||
3)
|
||||
task_command=$(cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $2}')
|
||||
eval $task_command && task_res='执行成功!' || task_res='执行失败!'
|
||||
logger "任务【$task_des】$task_res" 33 off
|
||||
sleep 1
|
||||
;;
|
||||
4)
|
||||
if [ "$task_id" = 0 ];then
|
||||
read -p "旧版任务不支持管理,是否移除?(1/0) > " res
|
||||
[ "$res" = 1 ] && {
|
||||
cronname=$(echo $task_txt | awk -F '-' '{print $2}')
|
||||
croncmd -l > $TMPDIR/conf && sed -i "/$cronname/d" $TMPDIR/conf && croncmd $TMPDIR/conf
|
||||
sed -i "/$cronname/d" $clashdir/tools/cron 2>/dev/null
|
||||
rm -f $TMPDIR/conf
|
||||
}
|
||||
else
|
||||
task_des=$(echo $task_txt | awk '{print $2}')
|
||||
task_name=$(cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $3}')
|
||||
echo -----------------------------------------------
|
||||
if [ -n "$(cat $TMPDIR/ShellCrash.log | grep "$task_name")" ];then
|
||||
cat $TMPDIR/ShellCrash.log | grep "$task_name"
|
||||
else
|
||||
echo -e "\033[31m未找到相关执行记录!\033[0m"
|
||||
fi
|
||||
sleep 1
|
||||
;;
|
||||
*)
|
||||
errornum
|
||||
;;
|
||||
esac
|
||||
|
||||
echo -e "当前任务为:\033[36m $task_des\033[0m"
|
||||
echo -e " 1 \033[33m修改\033[0m当前任务"
|
||||
echo -e " 2 \033[31m删除\033[0m当前任务"
|
||||
echo -e " 3 \033[32m立即执行\033[0m一次"
|
||||
echo -e " 4 查看\033[33m执行记录\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 0 返回上级菜单"
|
||||
read -p "请选择需要执行的操作 > " num
|
||||
case "$num" in
|
||||
0)
|
||||
;;
|
||||
1)
|
||||
task_type && task_del $task_des
|
||||
;;
|
||||
2)
|
||||
task_del $task_des
|
||||
;;
|
||||
3)
|
||||
task_command=$(cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $2}')
|
||||
eval $task_command && task_res='执行成功!' || task_res='执行失败!'
|
||||
logger "任务【$task_des】$task_res" 33 off
|
||||
sleep 1
|
||||
;;
|
||||
4)
|
||||
echo -----------------------------------------------
|
||||
if [ -n "$(cat ${TMPDIR}/ShellCrash.log | grep "$task_name")" ];then
|
||||
cat ${TMPDIR}/ShellCrash.log | grep "$task_name"
|
||||
else
|
||||
echo -e "\033[31m未找到相关执行记录!\033[0m"
|
||||
fi
|
||||
sleep 1
|
||||
;;
|
||||
*)
|
||||
errornum
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
task_manager
|
||||
;;
|
||||
*)
|
||||
@@ -434,13 +462,15 @@ task_recom(){ #任务推荐
|
||||
echo -----------------------------------------------
|
||||
read -p "是否启用?(1/0) > " res
|
||||
[ "$res" = 1 ] && {
|
||||
set_service running "106" "运行时每10分钟自动保存面板配置" "*/10"
|
||||
set_service running "106" "运行时每10分钟自动保存面板配置" "*/10 * * * *"
|
||||
set_service afstart "107" "服务启动后自动同步ntp时间"
|
||||
cronset "在每周3的3点整更新订阅并重启服务" "0 3 * * 3 $CRASHDIR/task/task.sh 104 在每周3的3点整更新订阅并重启服务" && \
|
||||
cronset "在每周3的3点整更新订阅并重启服务" "0 3 * * 3 ${CRASHDIR}/task/task.sh 104 在每周3的3点整更新订阅并重启服务" && \
|
||||
echo -e "任务【在每周3的3点整更新订阅并重启服务】\033[32m添加成功!\033[0m"
|
||||
}
|
||||
}
|
||||
task_menu(){ #任务菜单
|
||||
#检测并创建自定义任务文件
|
||||
[ -f ${CRASHDIR}/task/task.user ] || echo '#任务ID(必须>200并顺序排列)#任务命令#任务说明(#号隔开,任务命令和说明中都不允许包含#号)' > ${CRASHDIR}/task/task.user
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[30;47m欢迎使用自动任务功能:\033[0m"
|
||||
echo -----------------------------------------------
|
||||
@@ -463,13 +493,13 @@ task_menu(){ #任务菜单
|
||||
;;
|
||||
2)
|
||||
task_manager
|
||||
rm -rf $TMPDIR/task_list
|
||||
rm -rf ${TMPDIR}/task_list
|
||||
task_menu
|
||||
;;
|
||||
3)
|
||||
if [ -n "$(cat $TMPDIR/ShellCrash.log | grep '任务【')" ];then
|
||||
if [ -n "$(cat ${TMPDIR}/ShellCrash.log | grep '任务【')" ];then
|
||||
echo -----------------------------------------------
|
||||
cat $TMPDIR/ShellCrash.log | grep '任务【'
|
||||
cat ${TMPDIR}/ShellCrash.log | grep '任务【'
|
||||
else
|
||||
echo -e "\033[31m未找到任务相关执行日志!\033[0m"
|
||||
fi
|
||||
@@ -507,8 +537,8 @@ case "$1" in
|
||||
task_menu
|
||||
;;
|
||||
[1-9][0-9][0-9])
|
||||
task_command=$(cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $2}')
|
||||
task_name=$(cat $CRASHDIR/task/task.list $CRASHDIR/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $3}')
|
||||
task_command=$(cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $2}')
|
||||
task_name=$(cat ${CRASHDIR}/task/task.list ${CRASHDIR}/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $3}')
|
||||
#logger "任务$task_name 开始执行"
|
||||
eval $task_command && task_res=成功 || task_res=失败
|
||||
logger "任务【$2】执行$task_res"
|
||||
|
||||
Reference in New Issue
Block a user