优化代码

This commit is contained in:
Hyy2001X 2021-05-06 21:16:09 +08:00
parent 1047ea5576
commit 07dee0844c
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ GET_TARGET_INFO() {
x86_Test="$(egrep -o "CONFIG_TARGET.*Generic=y" .config | sed -r 's/CONFIG_TARGET_(.*)_Generic=y/\1/')" x86_Test="$(egrep -o "CONFIG_TARGET.*Generic=y" .config | sed -r 's/CONFIG_TARGET_(.*)_Generic=y/\1/')"
[[ -z "${x86_Test}" ]] && TIME "[ERROR] Can not obtain the TARGET_PROFILE !" && exit 1 [[ -z "${x86_Test}" ]] && TIME "[ERROR] Can not obtain the TARGET_PROFILE !" && exit 1
done done
[[ "${x86_Test}" == "x86_64" ]] && { [[ "${x86_Test}" == x86_64 ]] && {
TARGET_PROFILE="x86_64" TARGET_PROFILE="x86_64"
} || { } || {
TARGET_PROFILE="$(egrep -o "CONFIG_TARGET.*DEVICE.*=y" .config | sed -r 's/.*DEVICE_(.*)=y/\1/')" TARGET_PROFILE="$(egrep -o "CONFIG_TARGET.*DEVICE.*=y" .config | sed -r 's/.*DEVICE_(.*)=y/\1/')"
@ -140,7 +140,7 @@ Firmware-Diy_Base() {
fi fi
} }
[ -f package/base-files/files/bin/AutoUpdate.sh ] && { [ -f package/base-files/files/bin/AutoUpdate.sh ] && {
AutoUpdate_Version=$(awk 'NR==6' package/base-files/files/bin/AutoUpdate.sh | awk -F '[="]+' '/Version/{print $2}') AutoUpdate_Version=$(egrep -o "V[0-9]+.[0-9].+" package/base-files/files/bin/AutoUpdate.sh | awk 'NR==1')
} || AutoUpdate_Version=OFF } || AutoUpdate_Version=OFF
Replace_File CustomFiles/Depends/profile package/base-files/files/etc Replace_File CustomFiles/Depends/profile package/base-files/files/etc
sed -i '/profile/d' package/base-files/files/lib/upgrade/keep.d/base-files-essential sed -i '/profile/d' package/base-files/files/lib/upgrade/keep.d/base-files-essential

View File

@ -226,7 +226,7 @@ else
rm /bin/AutoUpdate.sh rm /bin/AutoUpdate.sh
mv -f ${Download_Path}/AutoUpdate.sh /bin mv -f ${Download_Path}/AutoUpdate.sh /bin
chmod +x /bin/AutoUpdate.sh chmod +x /bin/AutoUpdate.sh
NEW_Version=$(egrep -o "V[0-9]+.[0-9]+" /bin/AutoUpdate.sh | awk 'NR==1') NEW_Version=$(egrep -o "V[0-9]+.[0-9].+" /bin/AutoUpdate.sh | awk 'NR==1')
TIME && echo "AutoUpdate [${Version}] > [${NEW_Version}]" TIME && echo "AutoUpdate [${Version}] > [${NEW_Version}]"
TIME && echo "AutoUpdate 脚本更新成功!" TIME && echo "AutoUpdate 脚本更新成功!"
exit 0 exit 0