Created
May 18, 2020 12:45
-
-
Save escowles/70fdf6fcd8cf1c269a5ec41275c596e9 to your computer and use it in GitHub Desktop.
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
#!/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