generated from P3TERX/Actions-OpenWrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
diy-part2.sh
executable file
·80 lines (68 loc) · 3.72 KB
/
diy-part2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
#
# https://github.com/P3TERX/Actions-OpenWrt
# File name: diy-part2.sh
# Description: OpenWrt DIY script part 2 (After Update feeds)
#
# Copyright (c) 2019-2024 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# Modify default IP
sed -i 's/192.168.1.1/192.168.50.201/g' package/base-files/files/bin/config_generate
# rm -rf feeds/luci/applications/luci-app-mosdns
# rm -rf feeds/packages/net/{alist,adguardhome,mosdns,xray*,v2ray*,sing-box,smartdns}
# rm -rf feeds/packages/utils/v2dat
#smartdns
rm -rf feeds/packages/net/smartdns/*
git clone https://github.com/pymumu/openwrt-smartdns feeds/packages/net/smartdns
rm -rf feeds/packages/net/smartdns/.git
rm -rf feeds/luci/applications/luci-app-smartdns/*
git clone https://github.com/pymumu/luci-app-smartdns feeds/luci/applications/luci-app-smartdns
rm -rf feeds/luci/applications/luci-app-smartdns/.git
#adguardhome
rm -rf feeds/packages/net/adguardhome/*
cp -r feeds/kenzo/adguardhome/* feeds/packages/net/adguardhome
#golang
rm -rf feeds/packages/lang/golang
git clone https://github.com/sbwml/packages_lang_golang feeds/packages/lang/golang
#v2ray-geodata
rm -rf feeds/packages/net/v2ray-geodata/*
git clone https://github.com/sbwml/v2ray-geodata feeds/packages/net/v2ray-geodata
rm -rf feeds/packages/net/v2ray-geodata/.git
# 创建OpenClash使用的clash二进制文件所在的路径
#mkdir -p files/etc/openclash/core
# 设置Clash下载地址变量
# 从github上指定分支的文件中下载
#OPENCLASH_MAIN_URL=$( curl -sL https://api.github.com/repos/vernesong/OpenClash/contents/dev/dev?ref=core | grep dev/clash-linux-amd64.tar.gz | awk -F '"' '{print $4}' | awk 'NR==4{print}' )
#CLASH_TUN_URL=$( curl -sL https://api.github.com/repos/vernesong/OpenClash/contents/dev/premium?ref=core | grep premium/clash-linux-amd64-20 | awk -F '"' '{print $4}' | awk 'NR==4{print}' )
#CLASH_META_URL=$( curl -sL https://api.github.com/repos/vernesong/OpenClash/contents/dev/meta?ref=core | grep meta/clash-linux-amd64.tar.gz | awk -F '"' '{print $4}' | awk 'NR==4{print}' )
# 下载并解压OpenClash的执行文件
#wget -qO- $OPENCLASH_MAIN_URL | tar xOvz > files/etc/openclash/core/clash
#wget -qO- $CLASH_TUN_URL | gunzip -c > files/etc/openclash/core/clash_tun
#wget -qO- $CLASH_META_URL | tar xOvz > files/etc/openclash/core/clash_meta
# 给Clash二进制文件增加执行权限
#chmod +x files/etc/openclash/core/clash*
#openclash core clash
#curl -sL -m 30 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/master/dev/clash-linux-amd64.tar.gz -o tmp/clash.tar.gz
#tar zxvf tmp/clash.tar.gz -C tmp >/dev/null 2>&1
#chmod +x tmp/clash >/dev/null 2>&1
#mkdir -p files/etc/openclash/core
#mv tmp/clash files/etc/openclash/core >/dev/null 2>&1
#rm -rf tmp/clash.tar.gz >/dev/null 2>&1
#openclash core clash_tun
#curl -sL -m 30 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/master/premium/clash-linux-amd64-2023.08.17-13-gdcc8d87.gz -o tmp/clash_tun.gz
#gzip -d tmp/clash_tun.gz >/dev/null 2>&1
#chmod +x tmp/clash_tun >/dev/null 2>&1
#mv tmp/clash_tun files/etc/openclash/core >/dev/null 2>&1
#openclash core clash_meta
curl -sL -m 30 --retry 2 https://raw.githubusercontent.com/vernesong/OpenClash/core/master/meta/clash-linux-amd64.tar.gz -o tmp/clash_meta.tar.gz
tar xzvf tmp/clash_meta.tar.gz -C tmp --transform='s/^clash/clash_meta/' >/dev/null 2>&1
chmod +x tmp/clash_meta >/dev/null 2>&1
mv tmp/clash_meta files/etc/openclash/core >/dev/null 2>&1
rm -rf tmp/clash_meta.tar.gz >/dev/null 2>&1
# Modify default theme
#sed -i 's/luci-theme-bootstrap/luci-theme-argon/g' feeds/luci/collections/luci/Makefile
# Modify hostname
#sed -i 's/OpenWrt/P3TERX-Router/g' package/base-files/files/bin/config_generate