From 02c75a7bdee1a05ffea552e8a4b90cbf98967dba Mon Sep 17 00:00:00 2001
From: Andrea Dell'Amico <andrea.dellamico@isti.cnr.it>
Date: Wed, 30 Oct 2019 10:38:01 +0100
Subject: [PATCH] Give the option to specify an env file from the command line.

---
 .../letsencrypt-acme-sh-client/files/acme-sh-request-cert   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/library/roles/letsencrypt-acme-sh-client/files/acme-sh-request-cert b/library/roles/letsencrypt-acme-sh-client/files/acme-sh-request-cert
index 47eaa129..70fed230 100644
--- a/library/roles/letsencrypt-acme-sh-client/files/acme-sh-request-cert
+++ b/library/roles/letsencrypt-acme-sh-client/files/acme-sh-request-cert
@@ -1,12 +1,16 @@
 #!/bin/bash
 
+if [ $# -ne 1 ] ; then
+    ACME_SH_ENV_FILE="$1"
+fi
+
 if [ -f "/etc/default/acme_sh_request_env" ] ; then
     . "/etc/default/acme_sh_request_env"
 else
     exit 1
 fi
 
-if [ -f "$ACME_SH_ENV_FILE" ] ; then
+if [ -n "$ACME_SH_ENV_FILE" ] && [ -f "$ACME_SH_ENV_FILE" ] ; then
     . "$ACME_SH_ENV_FILE"
 else
     exit 1