summaryrefslogtreecommitdiff
path: root/certexpiry.sh
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2018-11-21 22:50:23 +0000
committerLuke Bratch <luke@bratch.co.uk>2018-11-21 22:50:23 +0000
commit607cb60110fab704bfa58668fbe2681df9fe0fd4 (patch)
treee6b94e8628896a9583912b5170ce375c99635676 /certexpiry.sh
parent004608179988a12cffcecfa9981303270d445eff (diff)
Move the list of hosts and ports to a separate file, plus add sample and readme files
Diffstat (limited to 'certexpiry.sh')
-rwxr-xr-xcertexpiry.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/certexpiry.sh b/certexpiry.sh
index 90c5fd6..ea2feeb 100755
--- a/certexpiry.sh
+++ b/certexpiry.sh
@@ -5,14 +5,11 @@ set -euo pipefail
# Output warning if fewer than this number of seconds until expiry
WARNSECONDS=1209600 # Two weeks
# Bash array of host:port combinations to be checked
-HOSTSANDPORTS=(irc.tghost.co.uk:6697 irc.lc8n.com:6697 irc.pgburton.com:6697 www.tghost.co.uk mail.tghost.co.uk:25 \
- mail.tghost.co.uk:143 mail.tghost.co.uk mumble.tghost.co.uk:64738 bladns.net www.lc8n.com \
- www.blatech.net upload.bratch.co.uk www.nokiaplan3.com davmail.tghost.co.uk:1143 bcal.tghost.co.uk \
- www.blaupload.co.uk up.org.je)
+HOSTSANDPORTS="hostsandports.txt"
# ==== Variables ====
# Loop through all host:port combinations
-for HOSTANDPORT in "${HOSTSANDPORTS[@]}" ; do
+while read HOSTANDPORT ; do
# echo "DEBUG: HOSTANDPORT: $HOSTANDPORT."
@@ -72,4 +69,4 @@ for HOSTANDPORT in "${HOSTSANDPORTS[@]}" ; do
# echo "DEBUG: The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$(expr $DIFFERENCE / 60 / 60 / 24) days)."
fi
-done
+done < "$HOSTSANDPORTS"