Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/buildscripts.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pkgupdate-watch.sh')
-rwxr-xr-xpkgupdate-watch.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkgupdate-watch.sh b/pkgupdate-watch.sh
index a4393b3..6cca0fe 100755
--- a/pkgupdate-watch.sh
+++ b/pkgupdate-watch.sh
@@ -14,12 +14,20 @@ while true; do
sort -nr | sed -ne '1s/^[0-9.]\+ //p')"
if [ -d "$log" ]; then
- msg="$(tail -n1 "$log/compile.txt")"
- if [ ${#msg} -gt 80 ]; then
- msg="${msg:0:80}"
+ d1=$(date +%s)
+ d2=$(date +%s -r "$log/compile.txt")
+
+ if [ $(($d1 - $d2)) -gt 5 ]; then
+ log="- idle -"
+ msg=""
+ else
+ msg="$(tail -n1 "$log/compile.txt")"
+ if [ ${#msg} -gt 80 ]; then
+ msg="${msg:0:80}"
+ fi
fi
else
- log="-"
+ log="- pending -"
msg=""
fi