Last active
August 29, 2015 14:16
-
-
Save kbinani/05d45686e57de7229879 to your computer and use it in GitHub Desktop.
autoincense.haka.yamashi.ro.cron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 0 * * * API_TOKEN="xxxx"; HOUR_FROM=11; HOUR_TO=22; function get_rand { local FROM=$1; local TO=$2; local DIFF=$(echo "$TO - $FROM" | bc); echo "$FROM + $DIFF * $(echo "ibase=16; $(openssl rand -hex 2 | tr a-f A-F)" | bc) / 65535" | bc; }; echo "sleep $(get_rand 0 59) >/dev/null 2>&1; curl -d token=$API_TOKEN http://haka.yamashi.ro/api/v1/incenses >/dev/null 2>&1" | at $(printf "\%02d:\%02d" $(get_rand $HOUR_FROM $HOUR_TO) $(get_rand 0 59)) >/dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment