Просмотр исходного кода

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

root 1 месяц назад
Родитель
Сommit
495a08d0bd
2 измененных файлов с 13 добавлено и 5 удалено
  1. 1 1
      README.md
  2. 12 4
      src/avto4certbot.sh

+ 1 - 1
README.md

@@ -1,6 +1,6 @@
1 1
 #### Package scripts for auto update all certs.
2 2
 #### Uses apache2 or nginx and the certbot package.
3
-#### avto4certbot version:0.5.7
3
+#### avto4certbot version:0.5.10
4 4
 
5 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 3
 # author: Koshuba V.O.
4 4
 # license: GPL 2.0
5 5
 # create 2022
6 6
 #
7
-version="0.5.7";
7
+version="0.5.10";
8 8
 sname="avto4certbot";
9 9
 
10 10
 # script path
@@ -103,12 +103,20 @@ fi
103 103
 
104 104
 ## create info active config sites 
105 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 111
   get_tools[${#get_tools[@]}]="apache2";
108 112
   web_service="$apache2_service";
109 113
 fi
110 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 120
   get_tools[${#get_tools[@]}]="nginx";
113 121
   web_service="nginx";
114 122
 fi