From 034af2003c45b50e4047b332f7bcdff725fe8fec Mon Sep 17 00:00:00 2001 From: Brandon Kreisel Date: Sun, 4 Oct 2015 20:07:00 -0400 Subject: [PATCH] Only ask for bash on OS X --- letsencrypt/plugins/manual.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/letsencrypt/plugins/manual.py b/letsencrypt/plugins/manual.py index f532b8fbc..179a7b49f 100644 --- a/letsencrypt/plugins/manual.py +++ b/letsencrypt/plugins/manual.py @@ -154,12 +154,18 @@ binary for temporary key/certificate generation.""".replace("\n", "") if self.conf("test-mode"): logger.debug("Test mode. Executing the manual command: %s", command) try: + # sh shipped with OS X does't support echo -n + if sys.platform == "darwin": + executable = "/bin/bash" + else: + executable = "/bin/sh" + self._httpd = subprocess.Popen( command, # don't care about setting stdout and stderr, # we're in test mode anyway shell=True, - executable="/bin/bash", + executable=executable, # "preexec_fn" is UNIX specific, but so is "command" preexec_fn=os.setsid) except OSError as error: # ValueError should not happen!