From 100f6dac3d40d736e15c30f174cbff34e4be1292 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sat, 27 Aug 2011 15:27:15 +0000
Subject: [PATCH] simple test script

---
 tests/scripts/checkcerts.sh | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100755 tests/scripts/checkcerts.sh

diff --git a/tests/scripts/checkcerts.sh b/tests/scripts/checkcerts.sh
new file mode 100755
index 0000000000..6191294673
--- /dev/null
+++ b/tests/scripts/checkcerts.sh
@@ -0,0 +1,30 @@
+#
+# Run 'certtool -i' on all certificate files
+# Returns nonzero on failure
+#
+# zzz 2011-08
+# public domain
+#
+
+cd `dirname $0`/../../installer/resources/certificates
+
+for i in *
+do
+	echo "Checking $i ..."
+	EXPIRES=`certtool -i < $i | grep 'Not After'`
+        if [ $? -ne 0 ]
+	then
+		echo "********* FAILED CHECK FOR $i *************"
+		FAIL=1
+	fi
+	echo $EXPIRES
+	# TODO - parse and fail if it expires soon
+done
+
+if [ "$FAIL" != "" ]
+then
+	echo "******** At least one file failed check *********"
+else
+	echo "All files passed"
+fi
+exit $FAIL
-- 
GitLab