SHARE
TWEET

Untitled

a guest Aug 21st, 2019 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. FILE="/mnt/data/temp/timelog.csv"
  3. CMD="curl -s -m 60 --output /dev/null https://f-droid.org/assets/favicon-16x16.png --resolve f-droid.org:443:5.9.48.82"
  4.  
  5. HDR=$(cat << HDR
  6. "# ${CMD}"
  7. "# Timestamp is MsExcel compatible, just format cell as date/time"
  8. "Timestamp","Time(s)","Error"
  9. HDR
  10. )
  11.  
  12. echo "$HDR" > "${FILE}"
  13. TIMEFORMAT=%R
  14. while sleep 60
  15. do
  16.     # Exit script when FILE is deleted, moved or renamed.
  17.     [ -e "${FILE}" ] || break
  18.     D=$(echo "($(date +%s%z*36)) / 86400 + 25569 " | bc -l)
  19.     T=$( (time ${CMD}) 2>&1 )
  20.     echo "$D,$T,$?" >> $FILE
  21. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top