兼容更多离线升级的情况
This commit is contained in:
6
scripts/autoupdate-usb.sh
Normal file → Executable file
6
scripts/autoupdate-usb.sh
Normal file → Executable 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
|
||||||
|
|||||||
Reference in New Issue
Block a user