更新 bin/ZeroWrt_mtk
Signed-off-by: zhao <zj18139624826@gmail.com>
This commit is contained in:
parent
1950ebb57a
commit
58e80c8f0e
@ -2017,8 +2017,8 @@ check_update() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 获取本地版本和远程版本
|
# 获取本地版本和远程版本
|
||||||
local_version=$(cat /root/version.txt 2>/dev/null || echo "0")
|
local_version=$(cat /root/mediatek.txt 2>/dev/null || echo "0")
|
||||||
remote_version=$(cat "$temp_dir/version.txt" 2>/dev/null || echo "0")
|
remote_version=$(cat "$temp_dir/mediatek.txt" 2>/dev/null || echo "0")
|
||||||
|
|
||||||
# 比较版本
|
# 比较版本
|
||||||
if [ "$local_version" != "$remote_version" ]; then
|
if [ "$local_version" != "$remote_version" ]; then
|
||||||
@ -2039,7 +2039,7 @@ check_update() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 下载新版本到临时文件
|
# 下载新版本到临时文件
|
||||||
if wget -q "https://git.kejizero.online/zhao/files/raw/branch/main/bin/ZeroWrt" -O "$temp_dir/ZeroWrt.new"; then
|
if wget -q "https://git.kejizero.online/zhao/files/raw/branch/main/bin/ZeroWrt_mtk" -O "$temp_dir/ZeroWrt.new"; then
|
||||||
# 检查文件是否为有效的 shell 脚本
|
# 检查文件是否为有效的 shell 脚本
|
||||||
if head -n1 "$temp_dir/ZeroWrt.new" | grep -q "^#!/bin/bash"; then
|
if head -n1 "$temp_dir/ZeroWrt.new" | grep -q "^#!/bin/bash"; then
|
||||||
# 备份当前版本
|
# 备份当前版本
|
||||||
@ -2050,7 +2050,7 @@ check_update() {
|
|||||||
chmod +x /bin/ZeroWrt
|
chmod +x /bin/ZeroWrt
|
||||||
|
|
||||||
# 更新版本文件
|
# 更新版本文件
|
||||||
echo "$remote_version" > /root/version.txt
|
echo "$remote_version" > /root/mediatek.txt
|
||||||
|
|
||||||
if [[ "$LANG_CHOICE" == "zh" ]]; then
|
if [[ "$LANG_CHOICE" == "zh" ]]; then
|
||||||
color_output "\e[32m更新成功!\e[0m"
|
color_output "\e[32m更新成功!\e[0m"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user