summaryrefslogtreecommitdiff
path: root/tools/qmail-tls-check_certs
diff options
context:
space:
mode:
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