Browse Source

fix scans enable Пн 06 апр 2026 02:50:34 MSK

root 1 month ago
parent
commit
495a08d0bd
2 changed files with 13 additions and 5 deletions
  1. 1 1
      README.md
  2. 12 4
      src/avto4certbot.sh

+ 1 - 1
README.md

@@ -1,6 +1,6 @@
1
 #### Package scripts for auto update all certs.
1
 #### Package scripts for auto update all certs.
2
 #### Uses apache2 or nginx and the certbot package.
2
 #### Uses apache2 or nginx and the certbot package.
3
-#### avto4certbot version:0.5.7
3
+#### avto4certbot version:0.5.10
4
 
4
 
5
 * If the error “Peer's Certificate issuer is not recognized” occurs, use the following parameter: 
5
 * If the error “Peer's Certificate issuer is not recognized” occurs, use the following parameter: 
6
 
6
 

+ 12 - 4
src/avto4certbot.sh

@@ -1,10 +1,10 @@
1
-#!/bin/bash -x
1
+#!/bin/bash
2
 #
2
 #
3
 # author: Koshuba V.O.
3
 # author: Koshuba V.O.
4
 # license: GPL 2.0
4
 # license: GPL 2.0
5
 # create 2022
5
 # create 2022
6
 #
6
 #
7
-version="0.5.7";
7
+version="0.5.10";
8
 sname="avto4certbot";
8
 sname="avto4certbot";
9
 
9
 
10
 # script path
10
 # script path
@@ -103,12 +103,20 @@ fi
103
 
103
 
104
 ## create info active config sites 
104
 ## create info active config sites 
105
 if [[ "$opt" != "" ]] && [[ $opt != "nginx" ]] && [[ "$opt" == "apache" ]]; then
105
 if [[ "$opt" != "" ]] && [[ $opt != "nginx" ]] && [[ "$opt" == "apache" ]]; then
106
-  ls -F -n $sites_apache/*|awk '{print$9":"$11}' >$tmp_dir/active_sites.inf
106
+  if [ "$(find $sites_apache/* -maxdepth 0 -type l -printf '%f\n'|wc -l)" != "0" ]; then
107
+    ls -F -n $sites_apache/*|awk '{print$9":"$11}' >$tmp_dir/active_sites.inf
108
+  else
109
+    touch $tmp_dir/active_sites.inf
110
+  fi
107
   get_tools[${#get_tools[@]}]="apache2";
111
   get_tools[${#get_tools[@]}]="apache2";
108
   web_service="$apache2_service";
112
   web_service="$apache2_service";
109
 fi
113
 fi
110
 if [[ "$opt" != "" ]] && [[ $opt != "apache" ]] && [[ "$opt" == "nginx" ]]; then
114
 if [[ "$opt" != "" ]] && [[ $opt != "apache" ]] && [[ "$opt" == "nginx" ]]; then
111
-  ls -F -n $sites_nginx/*|awk '{print$9":"$11}' >$tmp_dir/active_sites.inf
115
+  if [ "$(find $sites_nginx/* -maxdepth 0 -type l -printf '%f\n'|wc -l)" != "0" ]; then
116
+    ls -F -n $sites_nginx/*|awk '{print$9":"$11}' >$tmp_dir/active_sites.inf
117
+  else
118
+    touch $tmp_dir/active_sites.inf
119
+  fi
112
   get_tools[${#get_tools[@]}]="nginx";
120
   get_tools[${#get_tools[@]}]="nginx";
113
   web_service="nginx";
121
   web_service="nginx";
114
 fi
122
 fi