Browse Source

fix function scan SSL 09.07.25:19.59

root 4 days ago
parent
commit
6b25396180
1 changed files with 10 additions and 8 deletions
  1. 10 8
      src/avto4certbot.sh

+ 10 - 8
src/avto4certbot.sh

@@ -4,7 +4,7 @@
4 4
 # license: GPL 2.0
5 5
 # create 2022
6 6
 #
7
-version="0.5.3";
7
+version="0.5.4";
8 8
 sname="avto4certbot";
9 9
 
10 10
 # script path
@@ -217,13 +217,15 @@ for ((xd=0; xd != ${#domains[@]}; xd++)); do
217 217
     keydate=$(ls -l --time-style=long-iso $path_cert/$site_name/cert.pem |awk {'print$6'});
218 218
     keytime=$(ls -l --time-style=long-iso $path_cert/$site_name/cert.pem |awk {'print$7'});
219 219
     if [ ! -f $path_ssl/certs/$site_name.pem ]; then
220
-        ((event_sw++));
221
-          cp -f $path_ssl/private/$site_name.pem $path_ssl/certs/$site_name.pem
222
-          cd $path_ssl/certs
223
-          chmod 600 $site_name.pem
224
-          ln -sf $site_name.pem `openssl x509 -noout -hash < $site_name.pem`.0
225
-          cd $path_ssl
226
-          echo "$(date) - $sname: update cert for  $site_name">> $log_file;
220
+      ((event_sw++));
221
+      if [ -f $path_ssl/private/$site_name.pem ]; then
222
+        cp -f $path_ssl/private/$site_name.pem $path_ssl/certs/$site_name.pem
223
+        cd $path_ssl/certs
224
+        chmod 600 $site_name.pem
225
+        ln -sf $site_name.pem `openssl x509 -noout -hash < $site_name.pem`.0
226
+        cd $path_ssl
227
+        echo "$(date) - $sname: update cert for  $site_name">> $log_file;
228
+      fi
227 229
     fi
228 230
 
229 231
     if [[ -f $path_ssl/private/$site_name.pem ]] && [[ "$keydate" = "$rdate" ]] && [[ "$keytime" = "$rtime" ]]; then