summaryrefslogtreecommitdiff
path: root/custom/simp_le.nix
diff options
context:
space:
mode:
Diffstat (limited to 'custom/simp_le.nix')
-rw-r--r--custom/simp_le.nix11
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 '';
26in 31in
27 "bash ${script} 2>&1 | ${eject}/bin/logger -p auth.info" 32 "bash ${script} 2>&1 | ${eject}/bin/logger -p auth.info"