Преглед изворни кода

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…
Откажи
Сачувај