Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 #135

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open

1 #135

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
cff5fcb
Create v2ray_update.sh
Lenyu2020 Jan 16, 2020
6d8b887
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
2f14957
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
e1f18d2
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
89365e5
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
d38ca75
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
8dfe366
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
510159f
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
7dbb0e4
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
2ee0e34
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
fe601f7
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
aeb6f7a
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
cf7e82e
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
4fc7cb4
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
38c01bf
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
9b2a16b
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
f1cb949
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
099baa0
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
3997246
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
ac74983
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
a024bc2
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
c8f20db
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
310bc16
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
5f3ee87
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
ba12c23
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
149051a
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
d794d80
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
dba6453
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
a9b1ac8
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
cb5cc95
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
50a7b50
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
6742bcf
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
d0cab87
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
acc37e1
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
b20760f
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
9c317ef
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
057cfe8
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
95b2a95
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
4165cc1
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
f98f686
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
d98a73d
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
7606bdf
Update v2ray_update.sh
Lenyu2020 Jan 16, 2020
d26b781
Update v2ray_update.sh
Blueplanet20120 Jan 17, 2020
3e9eec6
Merge pull request #1 from Blueplanet20120/patch-1
Lenyu2020 Jan 17, 2020
549ea23
Update v2ray_update.sh
Lenyu2020 Jan 17, 2020
76f1835
Update v2ray_update.sh
Lenyu2020 Jan 17, 2020
ff89c67
Update v2ray_update.sh
Lenyu2020 Jan 17, 2020
1e620aa
Create v2_update.sh
Lenyu2020 Jan 17, 2020
274d62d
Update v2_update.sh
Lenyu2020 Jan 17, 2020
7cf8f97
Update v2_update.sh
Lenyu2020 Jan 17, 2020
e481821
Update v2_update.sh
Lenyu2020 Jan 17, 2020
2e7e16d
Update v2_update.sh
Lenyu2020 Jan 17, 2020
fb77c72
Update v2_update.sh
Lenyu2020 Jan 17, 2020
951f667
Update v2_update.sh
Lenyu2020 Jan 17, 2020
f6b3fc6
Delete v2ray_update.sh
Lenyu2020 Jan 17, 2020
b4a6565
Update v2_update.sh
Lenyu2020 Jan 17, 2020
557bc30
Update v2_update.sh
Lenyu2020 Jan 18, 2020
17406e8
Update v2_update.sh
Lenyu2020 Jan 18, 2020
cc8575c
Update v2_update.sh
Lenyu2020 Jan 18, 2020
ec54d32
Update v2_update.sh
Lenyu2020 Jan 18, 2020
70d5e3a
Update v2_update.sh
Lenyu2020 Jan 18, 2020
1a4b55b
Update v2_update.sh
Lenyu2020 Jan 18, 2020
5b9089e
Update v2_update.sh
Lenyu2020 Jan 18, 2020
0312a4e
Update v2_update.sh
Lenyu2020 Jan 18, 2020
20bfd59
Update v2_update.sh
Lenyu2020 Jan 18, 2020
eb4444b
Update v2_update.sh
Lenyu2020 Jan 18, 2020
36fa2aa
Update v2_update.sh
Lenyu2020 Jan 18, 2020
be8a38b
Update v2_update.sh
Lenyu2020 Jan 18, 2020
43b7682
Create xray-update.sh
Lenyu2020 Jan 17, 2021
7cb6e15
Update xray-update.sh
Lenyu2020 Jan 18, 2021
201b85c
更新到version v1.1.2
Lenyu2020 Jan 19, 2021
a59fa0d
Update xray-update.sh
Lenyu2020 Jan 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions v2_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash
#只能在x86-64的openwrt系统上更lean大佬的XXXPLUS和passwall的v2插件!
# bash -c "$(wget -O- https://git.io/JvTVT)"
#Version: v2.0.2 By Len yu.
cd /tmp/tmp
rm -rf *
echo
clear
echo
echo
echo -e " $green Version: v2.0.2 By Len yu.$none"
echo
echo -e " $green 只能x86-64的openwrt系统上,可更新lean大佬的XXXPLUS和passwall的v2插件!$none"
sleep 2
clear
echo
echo -e " $green 正在获取网络v2ray最新版信息..$none"
echo
#judgment
v2ray_latest_ver="$(curl -H 'Cache-Control: no-cache' -s https://api.github.com/repos/v2ray/v2ray-core/releases/latest | grep 'tag_name' | cut -d\" -f4)"
sleep 2
v2ray_ver="v$(/usr/bin/v2ray/v2ray -version | grep "V2" | awk '{print $2}')" &> /dev/null
if [ "$v2ray_ver" != "$v2ray_latest_ver" ]; then
clear
echo
echo -e " $green 咦...发现新版本耶....正在拼命更新.......$none"
echo
v2ray_download_link="https://github.com/v2ray/v2ray-core/releases/download/$v2ray_latest_ver/v2ray-linux-64.zip"
echo
echo
wget "$v2ray_download_link"
unzip -o v2ray-linux-64.zip &> /dev/null
echo
else
clear
echo
echo -e " $green 木有发现新版本....$none"
echo
exit 0
fi
##install
st="`ps | grep "passwall" | awk '{print $8}' | cut -d/ -f4`" &> /dev/null
sr="`ps -ef | grep "ssr-retcp" | awk '{print $9}' | echo ${sr: 13:5}`" &> /dev/null
if [[ "$st" = "passwall" && -e /tmp/tmp/v2ray ]]; then
mv -f /tmp/tmp/v2ctl /usr/bin/v2ray
mv -f /tmp/tmp/v2ray /usr/bin/v2ray
chmod 755 /usr/bin/v2ray/v2ctl
chmod 755 /usr/bin/v2ray/v2ray
/etc/init.d/passwall restart
echo
echo -e " $green 更新成功啦...当前 V2Ray 版本: ${cyan}$v2ray_latest_ver$none"
echo
echo -e " $yellow 温馨提示: 为了避免出现莫名其妙的问题..V2Ray路由端的版本最好和服务器的版本保持一致$none"
echo
echo
exit 0
elif [[ "$sr" = "retcp" && -e /tmp/tmp/v2ray ]]; then
mv -f /tmp/tmp/v2ctl /usr/bin/v2ray
mv -f /tmp/tmp/v2ray /usr/bin/v2ray
chmod 755 /usr/bin/v2ray/v2ctl
chmod 755 /usr/bin/v2ray/v2ray
/etc/init.d/shadowsocksr restart
echo
echo -e " $green 更新成功啦...当前 V2Ray 版本: ${cyan}$v2ray_latest_ver$none"
echo
echo -e " $yellow 温馨提示: 为了避免出现莫名其妙的问题...V2Ray路由端的版本最好和服务器的版本保持一致$none"
echo
echo
exit 0
else
echo
echo -e "$red 下载 V2Ray 失败[需要连接科学]...请重试...$none"
echo
echo
exit 0
fi
168 changes: 168 additions & 0 deletions xray-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#/usr/bin/bash
#Author Lenyu
#version v1.1.3
#获取当前绝对路径
#echo "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd /home/lenyu
echo
echo "准备获取最新的xray源码版本…"
echo
sh_new_ver=$(wget --no-check-certificate -qO- -t1 -T3 "https://github.com/XTLS/Xray-core/commits/main")
echo $sh_new_ver > 110
sleep 2
# 把文本内容格式化输出
printf '%s\t %s\t %s\t %s\n' $(cat 110) > 111
#获得最新值MD5值的那列
grep "https://github.com/XTLS/Xray-core/commit/" 111 > 112
sleep 0.2
#获得最新值
new_ver=` cat 112 | cut -b 52-91`
echo $new_ver > new_ver

#if条件判断old_ver文件是否存在,不存在创建 -f 判断文件 -d 判断文件夹
if [ ! -f "old_ver" ]; then
clear
echo "old_ver被删除正在创建!"
sleep 0.1
echo $new_ver > old_ver
fi
sleep 0.1
old_ver=`cat old_ver`
if [ "$new_ver" = "$old_ver" ]; then
clear
echo "还没有最新的版本,请过段时间再试!"
echo "no_update" > /home/lenyu/noxray
else
clear
echo "发现更新,准备切换到最新的commit分支MD5"
echo "update" > /home/lenyu/noxray
sleep 1
#替换最新的md5值 sed要使用""才会应用变量
sed -i "s/.*PKG_SOURCE_VERSION:.*/PKG_SOURCE_VERSION:=$new_ver/" /home/lenyu/lede/package/lean/xray/Makefile
fi
echo
###判断ssr+是否有更新-开始###
new_ssr=$(wget --no-check-certificate -qO- -t1 -T3 "https://github.com/fw876/helloworld/commits/master")
sleep 0.2
echo $new_ssr > ssr1
printf '%s\t %s\t %s\t %s\n' $(cat ssr1) > ssr2
grep "https://github.com/fw876/helloworld/commits/master?after=" ssr2 > ssr3
sleep 0.1
#获得最新值
new_ssr=` cat ssr3 | cut -b 64-103`
echo $new_ssr > new_ssr
#if条件判断old_ssr文件是否存在,不存在创建 -f 判断文件 -d 判断文件夹
if [ ! -f "old_ssr" ]; then
clear
echo "old_ssr被删除正在创建!"
sleep 0.1
echo $new_ssr > old_ssr
fi
sleep 0.1
old_ssr=`cat old_ssr`
if [ "$new_ssr" = "$old_ssr" ]; then
echo "no_update" > /home/lenyu/nossr
else
echo "update" > /home/lenyu/nossr
echo $new_ssr > old_ssr
fi
echo
###判断ssr+是否有更新-结束###
echo
###判断passwall是否有更新-开始###
new_passw=$(wget --no-check-certificate -qO- -t1 -T3 "https://github.com/xiaorouji/openwrt-passwall/commits/main")
sleep 0.2
echo $new_passw > passw1
printf '%s\t %s\t %s\t %s\n' $(cat passw1) > passw2
grep "https://github.com/xiaorouji/openwrt-passwall/commit/" passw2 > passw3
sleep 0.1
#获得最新值
new_passw=` cat passw3 | cut -b 70-109`
echo $new_passw > new_passw
#if条件判断old_ssr文件是否存在,不存在创建 -f 判断文件 -d 判断文件夹
if [ ! -f "old_passw" ]; then
clear
echo "old_passw被删除正在创建!"
sleep 0.1
echo $new_passw > old_passw
fi
sleep 0.1
old_passw=`cat old_passw`
if [ "$new_passw" = "$old_passw" ]; then
echo "no_update" > /home/lenyu/nopassw
else
echo "update" > /home/lenyu/nopassw
echo $new_passw > old_passw
fi
echo
###判断passwall是否有更新-结束###
echo
#检查固件是否更新
cd /home/lenyu/lede
clear
echo "准备检查固件是否更新…"
s1=`git pull`
sleep 0.2
s2=`git -C ~/lede/package/luci-app-openclash pull`
sleep 0.2
if [[ "$s1" = "Already up to date." ]]; then
clear
echo "lede、ssr+或passwall源码没有更新…"
echo "no_update" > /home/lenyu/nolede
else
echo "update" > /home/lenyu/nolede
fi
echo
if [[ "$s2" = "Already up to date." ]]; then
clear
echo "luci-app-openclash源码没有更新…"
echo "no_update" > /home/lenyu/noopclash
else
echo "update" > /home/lenyu/noopclash
fi
echo
clear
sleep 0.1
#总结判断之
nolede=`cat /home/lenyu/nolede`
noopclash=`cat /home/lenyu/noopclash`
noxray=`cat /home/lenyu/noxray`
nossr=`cat /home/lenyu/nossr`
nopassw=`cat /home/lenyu/nopassw`
sleep 0.2
if [[("$nolede" = "update") || ("$noopclash" = "update") || ("$noxray" = "update") || ("$nossr" = "update" ) || ("$nopassw" = "update" )]]; then
clear
echo
echo "发现更新,请稍后…"
clear
echo
echo "准备开始编译最新固件…"
source /etc/environment && cd /home/lenyu/lede && git pull && git -C ~/lede/package/luci-app-openclash pull && ./scripts/feeds update -a && ./scripts/feeds install -a && make defconfig && make -j8 download && make -j10 V=s && bash rename.sh
echo
echo $new_ver > /home/lenyu/old_ver
rm -rf /home/lenyu/noxray
rm -rf /home/lenyu/noopclash
rm -rf /home/lenyu/nolede
rm -rf /home/lenyu/nossr
rm -rf /home/lenyu/nopassw
echo "固件编译成功,脚本退出!"
echo
exit 0
fi
echo
if [[("$nolede" = "no_update") && ("$noopclash" = "no_update") && ("$noxray" = "no_update") && ("$nossr" = "no_update" ) && ("$nopassw" = "no_update" )]]; then
clear
echo
echo "呃呃…检查lede/ssr+/xray/passwall/openclash源码,没有一个源码更新哟…还是稍安勿躁…"
fi
#脚本结束,准备最后的清理工作
echo $new_ver > /home/lenyu/old_ver
rm -rf /home/lenyu/noxray
rm -rf /home/lenyu/noopclash
rm -rf /home/lenyu/nolede
rm -rf /home/lenyu/nossr
rm -rf /home/lenyu/nopassw
echo
echo "脚本退出!"
echo
exit 0