Browse Source

fix rescan ssl 26.01.25:23.09

root 2 months ago
parent
commit
b9da9413f3
1 changed files with 9 additions and 6 deletions
  1. 9 6
      dev/avto4certbot.sh

+ 9 - 6
dev/avto4certbot.sh

@@ -213,11 +213,11 @@ rtime=$(date +%H:%M);
213 213
 for ((xd=0; xd != ${#domains[@]}; xd++)); do
214 214
   local site_data=( $(echo -e ${domains[$xd]}|sed 's/ /\n /g') );
215 215
   site_name="${site_data[0]}";
216
-  keydate=$(ls -l --time-style=long-iso $path_cert/$site_name/cert.pem |awk {'print$6'});
217
-  keytime=$(ls -l --time-style=long-iso $path_cert/$site_name/cert.pem |awk {'print$7'});
218
-  if [[ "$keydate" = "$rdate" ]] && [[ "$keytime" = "$rtime" ]]; then
219
-    ((event_sw++));
220
-      if [ -d $path_cert/$site_name ]; then
216
+  if [ -d $path_cert/$site_name ]; then
217
+    keydate=$(ls -l --time-style=long-iso $path_cert/$site_name/cert.pem |awk {'print$6'});
218
+    keytime=$(ls -l --time-style=long-iso $path_cert/$site_name/cert.pem |awk {'print$7'});
219
+    if [[ "$keydate" = "$rdate" ]] && [[ "$keytime" = "$rtime" ]]; then
220
+      ((event_sw++));
221 221
         cat $path_cert/$site_name/privkey.pem > $path_ssl/private/privkey_$site_name.pem;
222 222
         cat $path_cert/$site_name/fullchain.pem > $path_ssl/private/fullchain_$site_name.pem;
223 223
         cat $path_cert/$site_name/fullchain.pem > $path_ssl/private/$site_name.pem;
@@ -229,7 +229,7 @@ for ((xd=0; xd != ${#domains[@]}; xd++)); do
229 229
         ln -sf $site_name.pem `openssl x509 -noout -hash < $site_name.pem`.0
230 230
         cd $path_ssl
231 231
         echo "$(date) - $sname: update cert for  $site_name">> $log;
232
-      fi
232
+    fi
233 233
   fi
234 234
 done
235 235
 
@@ -339,6 +339,7 @@ if [ "$opt" != "" ]; then
339 339
     systemctl stop $web_service;
340 340
     swSites;
341 341
     systemctl start $web_service;
342
+    updateScs;
342 343
 else
343 344
     pHelp;
344 345
 fi
@@ -360,6 +361,7 @@ if [ "$opt" != "" ]; then
360 361
    systemctl stop $web_service;
361 362
    swSites;
362 363
    systemctl start $web_service;
364
+   updateScs;
363 365
 else
364 366
     pHelp;
365 367
 fi
@@ -371,6 +373,7 @@ if [ "$opt" != "" ]; then
371 373
     getInfo;
372 374
     checkDep;
373 375
     scanSSL;
376
+    updateScs;
374 377
 else
375 378
     pHelp;
376 379
 fi