Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stupidloud committed Dec 6, 2023
1 parent ecff81c commit 752b7e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/autoupdate-bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ rm -rf /tmp/upg && mkdir /tmp/upg && cd /tmp/upg

latest_release_tag=`get_latest_release stupidloud/nanopi-openwrt`
echo -e '\e[92m准备更新到'$latest_release_tag'\e[0m'
md5sum=`wget https://ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$latest_release_tag/$board_id$ver.img.gz -O- | tee >(gzip -dc>$board_id.img) | md5sum | awk '{print $1}'`
md5sum=`wget https://mirror.ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$latest_release_tag/$board_id$ver.img.gz -O- | tee >(gzip -dc>$board_id.img) | md5sum | awk '{print $1}'`
if [ "$md5sum" != "d41d8cd98f00b204e9800998ecf8427e" ]; then
wget https://ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$latest_release_tag/$board_id$ver.img.gz.md5 -O md5sum.txt
wget https://mirror.ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$latest_release_tag/$board_id$ver.img.gz.md5 -O md5sum.txt
echo -e '\e[92m'$latest_release_tag'固件已下载\e[0m'
fi

Expand Down
12 changes: 6 additions & 6 deletions scripts/autoupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ proceed_command sfdisk
proceed_command losetup
proceed_command resize2fs
opkg install coreutils-truncate || true
wget -NP /tmp https://ghproxy.com/https://raw.githubusercontent.com/stupidloud/nanopi-openwrt/zstd-bin/truncate
wget -NP /tmp https://ghproxy.com/https://raw.githubusercontent.com/stupidloud/nanopi-openwrt/zstd-bin/ddnz
wget -NP /tmp https://mirror.ghproxy.com/https://raw.githubusercontent.com/stupidloud/nanopi-openwrt/zstd-bin/truncate
wget -NP /tmp https://mirror.ghproxy.com/https://raw.githubusercontent.com/stupidloud/nanopi-openwrt/zstd-bin/ddnz
chmod +x /tmp/truncate /tmp/ddnz

board_id=$(cat /etc/board.json | jsonfilter -e '@["model"].id' | sed 's/friendly.*,nanopi-//;s/xunlong,orangepi-//;s/^r1s-h5$/r1s/;s/^r1$/r1s-h3/;s/^r1-plus$/r1p/;s/^r1-plus-lts$/r1p-lts/;s/default-string-default-string/x86/;s/vmware-inc-vmware7-1/x86/')
Expand All @@ -22,15 +22,15 @@ arch=`uname -m`
mount -t tmpfs -o remount,size=850m tmpfs /tmp
rm -rf /tmp/upg && mkdir /tmp/upg && cd /tmp/upg
set +e
wget https://ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date +%Y-%m-%d)/$board_id$ver.img.gz -O- | gzip -dc > $board_id.img
wget https://mirror.ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date +%Y-%m-%d)/$board_id$ver.img.gz -O- | gzip -dc > $board_id.img
if [ $? -eq 0 ]; then
wget https://ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date +%Y-%m-%d)/$board_id$ver.img.md5 -O md5sum.txt
wget https://mirror.ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date +%Y-%m-%d)/$board_id$ver.img.md5 -O md5sum.txt
echo -e '\e[92m今天固件已下载,准备解压\e[0m'
else
echo -e '\e[91m今天的固件还没更新,尝试下载昨天的固件\e[0m'
wget https://ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/$board_id$ver.img.gz -O- | gzip -dc > $board_id.img
wget https://mirror.ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/$board_id$ver.img.gz -O- | gzip -dc > $board_id.img
if [ $? -eq 0 ]; then
wget https://ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/$board_id$ver.img.md5 -O md5sum.txt
wget https://mirror.ghproxy.com/https://github.com/stupidloud/nanopi-openwrt/releases/download/$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/$board_id$ver.img.md5 -O md5sum.txt
echo -e '\e[92m昨天的固件已下载,准备解压\e[0m'
else
echo -e '\e[91m没找到最新的固件,脚本退出\e[0m'
Expand Down

0 comments on commit 752b7e6

Please sign in to comment.