generated from P3TERX/Actions-OpenWrt
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdiy-part2.sh
executable file
·85 lines (75 loc) · 3.16 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
81
82
83
84
85
#!/bin/bash
#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# File name: diy-part2.sh
# Description: OpenWrt DIY script part 2 (After Update feeds)
#
# Modify default IP
sed -i 's/192.168.1.1/192.168.6.1/g' package/base-files/files/bin/config_generate
#sed -i 's/192.168.1.1/192.168.8.1/g' package/base-files/files/bin/config_generate
# 取消登陆密码
sed -i 's/^\(.*99999\)/#&/' package/lean/default-settings/files/zzz-default-settings
# 删除自带 v2ray-geodata
rm -rf feeds/packages/net/v2ray-geodata
rm -rf package/feeds/packages/v2ray-geodata
# 拉取 passwall-packages
git clone https://github.com/xiaorouji/openwrt-passwall-packages.git package/passwall/packages
#cd package/passwall/packages
#git checkout fed70a5113b60c96d9c8182e40770f37c83d67ba
#cd -
# 拉取 luci-app-passwall
git clone https://github.com/xiaorouji/openwrt-passwall.git package/passwall/luci
#cd package/passwall/luci
#git checkout ebd3355bdf2fcaa9e0c43ec0704a8d9d8cf9f658
#cd -
# 拉取 ShadowSocksR Plus+
#git clone https://github.com/fw876/helloworld.git -b master package/helloworld
# 删除自带 msd_lite
rm -rf feeds/packages/net/msd_lite
rm -rf package/feeds/packages/msd_lite
# 拉取 msd_lite、luci-app-msd_lite
git clone https://github.com/ximiTech/msd_lite.git package/msd_lite/msd_lite
git clone https://github.com/ximiTech/luci-app-msd_lite.git package/msd_lite/luci-app-msd_lite
# 拉取 OpenAppFilter、luci-app-oaf
git clone https://github.com/destan19/OpenAppFilter.git package/OpenAppFilter
# 删除 passwall-packages 中 gn
#rm -rf package/passwall/packages/gn
# 删除 passwall-packages 中 naiveproxy
rm -rf package/passwall/packages/naiveproxy
# 删除自带 pgyvpn
#rm -rf feeds/packages/net/pgyvpn
# 删除自带 tailscale
rm -rf feeds/packages/net/tailscale
# 筛选程序
function merge_package(){
# 参数1是分支名,参数2是库地址。所有文件下载到指定路径。
# 同一个仓库下载多个文件夹直接在后面跟文件名或路径,空格分开。
trap 'rm -rf "$tmpdir"' EXIT
branch="$1" curl="$2" target_dir="$3" && shift 3
rootdir="$PWD"
localdir="$target_dir"
[ -d "$localdir" ] || mkdir -p "$localdir"
tmpdir="$(mktemp -d)" || exit 1
git clone -b "$branch" --depth 1 --filter=blob:none --sparse "$curl" "$tmpdir"
cd "$tmpdir"
git sparse-checkout init --cone
git sparse-checkout set "$@"
for folder in "$@"; do
mv -f "$folder" "$rootdir/$localdir"
done
cd "$rootdir"
}
# 提取 gn
#merge_package openwrt-23.05 https://github.com/immortalwrt/packages.git package/passwall/packages devel/gn
# 提取 naiveproxy
#merge_package master https://github.com/immortalwrt/packages.git package/passwall/packages net/naiveproxy
merge_package v5 https://github.com/sbwml/openwrt_helloworld.git package/passwall/packages naiveproxy
# 提取 pgyvpn
#merge_package packages-pgyvpn https://github.com/hue715/lean-packages.git feeds/packages/net net/pgyvpn
# 提取 tailscale
merge_package openwrt-23.05 https://github.com/immortalwrt/packages.git feeds/packages/net net/tailscale