Przeglądaj źródła

Merge pull request #518 from nodiscc/patch-1

bash syntax cleanup
Allen Riddell 8 lat temu
rodzic
commit
f21edc8ee4

+ 3
- 2
roles/common/files/etc_cron-monthly_letsencrypt-renew Wyświetl plik

1
 #!/bin/bash
1
 #!/bin/bash
2
+set -o errexit
2
 # Renew all live certificates with LetsEncrypt.  This needs to run at least
3
 # Renew all live certificates with LetsEncrypt.  This needs to run at least
3
 # once every three months.
4
 # once every three months.
4
 
5
 
11
 }
12
 }
12
 
13
 
13
 service apache2 stop
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
   /root/letsencrypt/letsencrypt-auto --renew certonly -c /etc/letsencrypt/cli.conf --domains=$domains
17
   /root/letsencrypt/letsencrypt-auto --renew certonly -c /etc/letsencrypt/cli.conf --domains=$domains
17
 done
18
 done
18
 service apache2 start
19
 service apache2 start

Ładowanie…
Anuluj
Zapisz