Преглед на файлове

Merge pull request #518 from nodiscc/patch-1

bash syntax cleanup
Allen Riddell преди 8 години
родител
ревизия
f21edc8ee4
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3
    2
      roles/common/files/etc_cron-monthly_letsencrypt-renew

+ 3
- 2
roles/common/files/etc_cron-monthly_letsencrypt-renew Целия файл

@@ -1,4 +1,5 @@
1 1
 #!/bin/bash
2
+set -o errexit
2 3
 # Renew all live certificates with LetsEncrypt.  This needs to run at least
3 4
 # once every three months.
4 5
 
@@ -11,8 +12,8 @@ function getDomains() {
11 12
 }
12 13
 
13 14
 service apache2 stop
14
-for c in `ls /etc/letsencrypt/live`; do
15
-  domains=$(getDomains /etc/letsencrypt/live/$c/cert.pem)
15
+for c in $(find /etc/letsencrypt/live/ -mindepth 1  -type d); do
16
+  domains=$(getDomains "$c"/cert.pem)
16 17
   /root/letsencrypt/letsencrypt-auto --renew certonly -c /etc/letsencrypt/cli.conf --domains=$domains
17 18
 done
18 19
 service apache2 start

Loading…
Отказ
Запис