From 6d0d937ebe2234b2ecfb04a8088c1b67c1b45565 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 13 Apr 2016 15:23:21 +0200 Subject: code cleanup --- custom/simp_le.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'custom/simp_le.nix') 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 cd ${dir} mkdir -p $backupDir for f in account_key.json cert.pem fullchain.pem key.pem privkey.pem; do - [[ -e $f ]] && mv $f $backupDir + [[ -e $f ]] && mv -v $f $backupDir done ${simp_le}/bin/simp_le -d ${domain}:/srv/www/acme/${domain}/ \ --email "phikeebaogobaegh@141.li" \ -f account_key.json \ -f cert.pem \ -f fullchain.pem \ - -f key.pem || { for f in *; do rm $f; done; mv $backupDir/* . && rmdir $backupDir; } - [[ -e key.pem ]] && ln -s -f key.pem privkey.pem + -f key.pem + if [[ $? -ne 0 ]]; then + for f in ./*; do rm -v $f; done + mv -v $backupDir/* . && rmdir $backupDir + else + [[ -e key.pem ]] && ln -s -f key.pem privkey.pem + fi ''; in "bash ${script} 2>&1 | ${eject}/bin/logger -p auth.info" -- cgit v1.2.3