summaryrefslogtreecommitdiff
path: root/tools/qmail-tls-check_certs
diff options
context:
space:
mode:
authorroot <root@cloud.av8n.net>2012-07-13 04:13:27 (GMT)
committerJohn Denker <jsd@av8n.com>2012-07-14 01:39:51 (GMT)
commit1ead9453f3dfc28cf797aafbcc7b6e56b69c4770 (patch)
treea76f20fe218e0ea827cced78acd523686ec826f9 /tools/qmail-tls-check_certs
parent86ce735baf5d85245f6fae24235f35820a0a1a7b (diff)
small improvements
Diffstat (limited to 'tools/qmail-tls-check_certs')
-rwxr-xr-xtools/qmail-tls-check_certs18
1 files changed, 16 insertions, 2 deletions
diff --git a/tools/qmail-tls-check_certs b/tools/qmail-tls-check_certs
index d8f97de..0d73596 100755
--- a/tools/qmail-tls-check_certs
+++ b/tools/qmail-tls-check_certs
@@ -29,11 +29,25 @@ for trydir in $dirlist ; do
fi
done
if test -z "$dir" ; then
- 1>&2 echo "Cannot find any control director ($dirlist)"
+ 1>&2 echo "Cannot find any control directory ($dirlist)"
exit 1
fi
-for cert in servercert.pem clientcert.pem ; do
+certlist=""
+for arg in "$@" ; do
+ case $arg in
+ -server) certlist="$certlist servercert.pem" ;;
+ -client) certlist="$certlist clientcert.pem" ;;
+ *) 1>&2 echo "Unrecognized verbiage: '$arg'"
+ exit 1
+ esac
+done
+
+if test -z "$certlist" ; then
+ certlist="servercert.pem clientcert.pem"
+fi
+
+for cert in $certlist ; do
if ! test -f "$dir/$cert"; then
echo "Certificate missing: $dir/$cert"
else