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.nix32
1 files changed, 0 insertions, 32 deletions
diff --git a/custom/simp_le.nix b/custom/simp_le.nix
deleted file mode 100644
index d37fbb8c..00000000
--- a/custom/simp_le.nix
+++ /dev/null
@@ -1,32 +0,0 @@
1{ stdenv, writeText
2, simp_le
3, eject
4}:
5#dir:
6domain:
7
8let
9 dir = "/etc/ssl/self/${domain}";
10 script = writeText "${domain}.sh" ''
11 backupDir=/root/ssl_archive/$(date +'%Y-%m-%d')-$$-${domain}
12 mkdir -p ${dir}
13 cd ${dir}
14 mkdir -p $backupDir
15 for f in account_key.json cert.pem fullchain.pem key.pem privkey.pem; do
16 [[ -e $f ]] && mv -v $f $backupDir
17 done
18 ${simp_le}/bin/simp_le -d ${domain}:/srv/www/acme/${domain}/ \
19 --email "phikeebaogobaegh@141.li" \
20 -f account_key.json \
21 -f cert.pem \
22 -f fullchain.pem \
23 -f key.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
30 '';
31in
32 "bash ${script} 2>&1 | ${eject}/bin/logger -p auth.info"