Skip to content

Instantly share code, notes, and snippets.

@escowles
Created May 18, 2020 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save escowles/70fdf6fcd8cf1c269a5ec41275c596e9 to your computer and use it in GitHub Desktop.
Save escowles/70fdf6fcd8cf1c269a5ec41275c596e9 to your computer and use it in GitHub Desktop.
#!/bin/sh
URL=${1:-https://catalog.princeton.edu}
EXP=`curl --insecure -v $URL 2>&1 | grep "* expire date" | sed -e's/* expire date: //'`
EXP_S=`date -j -f "%B %e %H:%M:%S %Y %Z" +%s "$EXP"`
NOW_S=`date +%s`
echo $URL: $(( ($EXP_S - $NOW_S) / (3600*24) )) days until expiration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment