Skip to content
Snippets Groups Projects
Commit 7fdd0300 authored by Jan-Philipp Litza's avatar Jan-Philipp Litza
Browse files

alfred: Add --no-sleep option to send immediately

parent 692f093d
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,10 @@ set -e
# 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
DELAY=$((0x$(sysconfig primary_mac | md5sum | head -c3) * $MAX_WAIT / (16**3)))
sleep $DELAY
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')"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment