diff --git a/package/diy/luci-app-ota/Makefile b/package/diy/luci-app-ota/Makefile index a57f3f0eab..be265ff853 100644 --- a/package/diy/luci-app-ota/Makefile +++ b/package/diy/luci-app-ota/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI for OTA upgrade LUCI_DEPENDS:=+curl LUCI_PKGARCH:=all -PKG_VERSION:=1.5.1 +PKG_VERSION:=1.5.2 PKG_RELEASE:=1 PKG_MAINTAINER:=jjm2473 diff --git a/package/diy/luci-app-ota/root/bin/ota b/package/diy/luci-app-ota/root/bin/ota index 6ddf5e7700..f470f0622a 100755 --- a/package/diy/luci-app-ota/root/bin/ota +++ b/package/diy/luci-app-ota/root/bin/ota @@ -116,11 +116,16 @@ lock_download() { } prepare_check() { + local latest=0 + if find /var/run/ota/check.status -mmin -5 2>/dev/null | grep -q . ; then + latest=`cat /var/run/ota/check.status` + return $latest + fi local line local release=`grep 'DISTRIB_RELEASE=' /etc/openwrt_release | sed -E "s/.*'(.+)'.*/\1/"` local revision=`grep 'DISTRIB_REVISION=' /etc/openwrt_release | sed -E "s/.*'(.+)'.*/\1/" | cut -d'-' -f1` local current="$release-$revision" - local latest=0 + cat /dev/null > /var/run/ota/ota.log fcurl --connect-timeout 5 -o /var/run/ota/ota.latest "$OTA_URL_BASE/version.latest" || { rm -f /var/run/ota/ota.latest ; return 255; } if head -1 /var/run/ota/ota.latest | grep -Fq "$current"; then @@ -139,6 +144,7 @@ prepare_check() { [ "`wc -l /var/run/ota/ota.log | cut -d' ' -f1`" -eq 0 ] && return 1 [ "`wc -l /var/run/ota/ota.index | cut -d' ' -f1`" -gt 5 ] && echo "More" >> /var/run/ota/ota.log fcurl --connect-timeout 1 "$OTA_URL_BASE/ota.footer.html" >> /var/run/ota/ota.log 2>/dev/null + echo "$latest" >/var/run/ota/check.status return $latest }