兼容更多离线升级的情况

This commit is contained in:
Guocheng Zheng
2020-04-14 19:55:10 +08:00
parent e7aea1591f
commit a9dfbec91d

6
scripts/autoupdate-usb.sh Normal file → Executable file
View File

@@ -1,13 +1,15 @@
#!/bin/sh #!/bin/sh
SHELLDIR=$(cd `dirname $0`; pwd)
echo "shell dir $SHELLDIR"
cd /mnt/mmcblk0p2 cd /mnt/mmcblk0p2
rm -rf artifact R2S*.zip FriendlyWrt*img* rm -rf artifact R2S*.zip FriendlyWrt*img*
cp $(dirname $(readlink -f $0))/R2S-Minimal-$(date +%Y-%m-%d)-ROM.zip ./ cp $SHELLDIR/R2S-Minimal-$(date +%Y-%m-%d)-ROM.zip ./
if [ -f /mnt/mmcblk0p2/R2S*.zip ]; then if [ -f /mnt/mmcblk0p2/R2S*.zip ]; then
echo -e '\e[92m今天固件已下载准备解压\e[0m' echo -e '\e[92m今天固件已下载准备解压\e[0m'
else else
echo -e '\e[91m今天的固件还没更新尝试下载昨天的固件\e[0m' echo -e '\e[91m今天的固件还没更新尝试下载昨天的固件\e[0m'
cp $(dirname $(readlink -f $0))/R2S-Minimal-$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)-ROM.zip ./ cp $SHELLDIR/R2S-Minimal-$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)-ROM.zip ./
if [ -f /mnt/mmcblk0p2/R2S*.zip ]; then if [ -f /mnt/mmcblk0p2/R2S*.zip ]; then
echo -e '\e[92m昨天的固件已下载准备解压\e[0m' echo -e '\e[92m昨天的固件已下载准备解压\e[0m'
else else