#!/usr/bin/env bash

# yyyy-mm-dd
YMD=$(date +%Y-%m-%d)

function record() {
  echo "$(date +%Y-%m-%dT%H:%M:%S%:z) $1" >> $HOME/ping-results/$YMD.txt
}

curl -s https://google.com > /dev/null && record ok || record fail

scp $HOME/ping-results/$YMD.txt bl:/var/www/fileserve/ping-results
