#!/usr/bin/zsh | |
# | |
# upload-crash-log spawns this as a subprocess in between log uploads. | |
# Run upload-logs-now to kill this process and make upload-crash-log | |
# start immediately (if it isn't already running). | |
# | |
read uptime idle </proc/uptime | |
uptime=${uptime%%.[0123456789]*} | |
DELAY=$((55 + $RANDOM % 10)) | |
sleep "$DELAY" & | |
pid=$! | |
trap 'kill -15 $pid' EXIT | |
trap 'exit 1' INT TERM | |
wait |