svn keywords
[myplc.git] / plc.d / ssl
index 8848349..ddbfe81 100755 (executable)
--- a/plc.d/ssl
+++ b/plc.d/ssl
@@ -7,8 +7,6 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id$
-#
 
 # Source function library and configuration
 . /etc/plc.d/functions
@@ -49,12 +47,12 @@ verify_or_generate_certificate() {
 
     if [ -f $crt ] ; then
        # Check if certificate is valid
-       verify=$(openssl verify -CAfile $ca $crt)
        # Backup if invalid or if the subject has changed
-       if grep -q "error" <<<$verify || \
+       if openssl verify -CAfile $ca $crt | grep -q "error" || \
            [ "$(ssl_cname $crt)" != "$cname" ] ; then
             backup_file $crt
             backup_file $ca
+            backup_file $key
        fi
     fi