diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-04-13 15:23:21 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-04-13 15:23:21 +0200 |
commit | 6d0d937ebe2234b2ecfb04a8088c1b67c1b45565 (patch) | |
tree | a407f4427ff93506174aba0545cf3c8ebdd2ecb3 /custom | |
parent | eb4d4acf6afb0cb241c75b7834c1742be46d8b69 (diff) | |
download | nixos-6d0d937ebe2234b2ecfb04a8088c1b67c1b45565.tar nixos-6d0d937ebe2234b2ecfb04a8088c1b67c1b45565.tar.gz nixos-6d0d937ebe2234b2ecfb04a8088c1b67c1b45565.tar.bz2 nixos-6d0d937ebe2234b2ecfb04a8088c1b67c1b45565.tar.xz nixos-6d0d937ebe2234b2ecfb04a8088c1b67c1b45565.zip |
code cleanup
Diffstat (limited to 'custom')
-rw-r--r-- | custom/simp_le.nix | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/custom/simp_le.nix b/custom/simp_le.nix index 755d8cd6..d37fbb8c 100644 --- a/custom/simp_le.nix +++ b/custom/simp_le.nix | |||
@@ -13,15 +13,20 @@ let | |||
13 | cd ${dir} | 13 | cd ${dir} |
14 | mkdir -p $backupDir | 14 | mkdir -p $backupDir |
15 | for f in account_key.json cert.pem fullchain.pem key.pem privkey.pem; do | 15 | for f in account_key.json cert.pem fullchain.pem key.pem privkey.pem; do |
16 | [[ -e $f ]] && mv $f $backupDir | 16 | [[ -e $f ]] && mv -v $f $backupDir |
17 | done | 17 | done |
18 | ${simp_le}/bin/simp_le -d ${domain}:/srv/www/acme/${domain}/ \ | 18 | ${simp_le}/bin/simp_le -d ${domain}:/srv/www/acme/${domain}/ \ |
19 | --email "phikeebaogobaegh@141.li" \ | 19 | --email "phikeebaogobaegh@141.li" \ |
20 | -f account_key.json \ | 20 | -f account_key.json \ |
21 | -f cert.pem \ | 21 | -f cert.pem \ |
22 | -f fullchain.pem \ | 22 | -f fullchain.pem \ |
23 | -f key.pem || { for f in *; do rm $f; done; mv $backupDir/* . && rmdir $backupDir; } | 23 | -f key.pem |
24 | [[ -e key.pem ]] && ln -s -f key.pem privkey.pem | 24 | if [[ $? -ne 0 ]]; then |
25 | for f in ./*; do rm -v $f; done | ||
26 | mv -v $backupDir/* . && rmdir $backupDir | ||
27 | else | ||
28 | [[ -e key.pem ]] && ln -s -f key.pem privkey.pem | ||
29 | fi | ||
25 | ''; | 30 | ''; |
26 | in | 31 | in |
27 | "bash ${script} 2>&1 | ${eject}/bin/logger -p auth.info" | 32 | "bash ${script} 2>&1 | ${eject}/bin/logger -p auth.info" |