diff --git a/scripts/autoupdate-usb.sh b/scripts/autoupdate-usb.sh old mode 100644 new mode 100755 index b112008..bb2e0ae --- a/scripts/autoupdate-usb.sh +++ b/scripts/autoupdate-usb.sh @@ -1,13 +1,15 @@ #!/bin/sh +SHELLDIR=$(cd `dirname $0`; pwd) +echo "shell dir $SHELLDIR" cd /mnt/mmcblk0p2 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 echo -e '\e[92m今天固件已下载,准备解压\e[0m' else 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 echo -e '\e[92m昨天的固件已下载,准备解压\e[0m' else