ソースを参照

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

読み込み中…
キャンセル
保存