From 74493b2ba5a0a370f7d5863c0a52c21d0e240b7c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 18 Jan 2014 21:56:05 +0100 Subject: [PATCH] gluon-alfred: run every minute The run frequency and exact time affect the alfred announce interval, so we can just run it every minute to supply alfred with the most up-to-date data. --- .../gluon-alfred/files/lib/gluon/alfred/announce.sh | 10 ---------- package/gluon-alfred/files/lib/gluon/cron/alfred | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/package/gluon-alfred/files/lib/gluon/alfred/announce.sh b/package/gluon-alfred/files/lib/gluon/alfred/announce.sh index d4533d30..ba17f323 100755 --- a/package/gluon-alfred/files/lib/gluon/alfred/announce.sh +++ b/package/gluon-alfred/files/lib/gluon/alfred/announce.sh @@ -15,19 +15,9 @@ fi # set defaults [ -z "$ALFRED_DATA_TYPE" ] && ALFRED_DATA_TYPE=158 [ -z "$NET_IF" ] && NET_IF=br-client -[ -z "$MAX_WAIT" ] && MAX_WAIT=299 set -e -# To avoid mass flooding the network every five minutes with all clients -# simultaneously, wait for a random time between 0 and 300 seconds, but fixed -# for each device to maintain 5 minutes between updates. -# Calculated using first 3 hex digits of the primary MAC address' MD5 hash -if [ "$1" != "--no-sleep" ]; then - DELAY=$((0x$(sysconfig primary_mac | md5sum | head -c3) * $MAX_WAIT / (16**3))) - sleep $DELAY -fi - json_init json_add_string "hostname" "$(uci get 'system.@system[0].hostname')" diff --git a/package/gluon-alfred/files/lib/gluon/cron/alfred b/package/gluon-alfred/files/lib/gluon/cron/alfred index 98cc382e..f9bde2f1 100644 --- a/package/gluon-alfred/files/lib/gluon/cron/alfred +++ b/package/gluon-alfred/files/lib/gluon/cron/alfred @@ -1 +1 @@ -*/5 * * * * /lib/gluon/alfred/announce.sh +* * * * * /lib/gluon/alfred/announce.sh