alfred: Add --no-sleep option to send immediately
This commit is contained in:
parent
692f093d21
commit
7fdd0300b2
@ -23,8 +23,10 @@ set -e
|
|||||||
# simultaneously, wait for a random time between 0 and 300 seconds, but fixed
|
# simultaneously, wait for a random time between 0 and 300 seconds, but fixed
|
||||||
# for each device to maintain 5 minutes between updates.
|
# for each device to maintain 5 minutes between updates.
|
||||||
# Calculated using first 3 hex digits of the primary MAC address' MD5 hash
|
# 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)))
|
DELAY=$((0x$(sysconfig primary_mac | md5sum | head -c3) * $MAX_WAIT / (16**3)))
|
||||||
sleep $DELAY
|
sleep $DELAY
|
||||||
|
fi
|
||||||
|
|
||||||
json_init
|
json_init
|
||||||
json_add_string "hostname" "$(uci get 'system.@system[0].hostname')"
|
json_add_string "hostname" "$(uci get 'system.@system[0].hostname')"
|
||||||
|
Loading…
Reference in New Issue
Block a user