X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fssl;h=ddbfe8166640263ed201115ed3e1f1aa6673745a;hb=21b4f7a59f68f5eb6acbc66f3a1fdc55675e405c;hp=e7e3278811111199ee5c4afb5c0a8be82930c6d5;hpb=a1d9cfaed3cedc96f0a6b23c934b28026c2afba4;p=myplc.git diff --git a/plc.d/ssl b/plc.d/ssl index e7e3278..ddbfe81 100755 --- a/plc.d/ssl +++ b/plc.d/ssl @@ -1,6 +1,4 @@ #!/bin/bash -# $Id$ -# $URL$ # # priority: 300 # @@ -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