Created
May 18, 2020 12:45
-
-
Save escowles/a10ea48f7cbe5300000ded290809387b 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