V3.0 Fix the bug of Firmware_name acquisition failure

This commit is contained in:
Hyy2001X 2020-09-25 10:07:58 +08:00
parent 53acd5b664
commit 504b15c5da
1 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
# AutoUpdate # AutoUpdate
Author=Hyy2001 Author=Hyy2001
Version=V2.9 Version=V3.0
Updated=2020.09.25 Updated=2020.09.25
TARGET_PROFILE=d-team_newifi-d2 TARGET_PROFILE=d-team_newifi-d2
FIRMWARE_SUFFIX=bin FIRMWARE_SUFFIX=bin
@ -23,7 +23,7 @@ if [ "$CURRENT_VERSION" == "" ]; then
echo -e "\n警告:当前固件版本获取失败!" echo -e "\n警告:当前固件版本获取失败!"
CURRENT_VERSION=未知 CURRENT_VERSION=未知
fi fi
CURRENT_DEVICE=`cat ./openwrt_device 2> /dev/null` CURRENT_DEVICE=`cat ./openwrt_device 2> /dev/null | awk 'NR==1'`
if [ "$CURRENT_DEVICE" == "" ]; then if [ "$CURRENT_DEVICE" == "" ]; then
echo -e "\n警告:当前设备名称获取失败,使用预设名称[$TARGET_PROFILE]" echo -e "\n警告:当前设备名称获取失败,使用预设名称[$TARGET_PROFILE]"
CURRENT_DEVICE=$TARGET_PROFILE CURRENT_DEVICE=$TARGET_PROFILE
@ -56,7 +56,7 @@ Firmware_Info="AutoBuild-${CURRENT_DEVICE}-Lede-${GET_Version}"
Firmware="${Firmware_Info}.${FIRMWARE_SUFFIX}" Firmware="${Firmware_Info}.${FIRMWARE_SUFFIX}"
Firmware_Detail="${Firmware_Info}.detail" Firmware_Detail="${Firmware_Info}.detail"
echo "云端固件名称:$Firmware" echo "云端固件名称:$Firmware"
Google_Check=`curl -I -s --connect-timeout 5 www.google.com -w %{http_code} | tail -n1` Google_Check=`curl -I -s --connect-timeout 5 www.google.com -w %{http_code} | tail -n1`
if [ ! "$Google_Check" == 200 ];then if [ ! "$Google_Check" == 200 ];then
TIME && echo "Google 连接失败,可能导致固件下载速度缓慢!" TIME && echo "Google 连接失败,可能导致固件下载速度缓慢!"
fi fi
@ -88,4 +88,4 @@ fi
TIME && echo "MD5对比通过,准备升级固件..." TIME && echo "MD5对比通过,准备升级固件..."
sleep 3 sleep 3
TIME && echo -e "开始升级固件,请耐心等待...\n" TIME && echo -e "开始升级固件,请耐心等待...\n"
sysupgrade $Firmware sysupgrade $Firmware