mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:52:02 +02:00
Merge pull request #1238 from devnsec-com/pr5
Use `printf` instead of `echo -n` for better portability
This commit is contained in:
+3
-3
@@ -25,9 +25,9 @@ pip install -U letsencrypt letsencrypt-apache # letsencrypt-nginx
|
|||||||
echo
|
echo
|
||||||
echo "Congratulations, Let's Encrypt has been successfully installed/updated!"
|
echo "Congratulations, Let's Encrypt has been successfully installed/updated!"
|
||||||
echo
|
echo
|
||||||
echo -n "Your prompt should now be prepended with ($VENV_NAME). Next "
|
printf "%s" "Your prompt should now be prepended with ($VENV_NAME). Next "
|
||||||
echo -n "time, if the prompt is different, 'source' this script again "
|
printf "time, if the prompt is different, 'source' this script again "
|
||||||
echo -n "before running 'letsencrypt'."
|
printf "before running 'letsencrypt'."
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo "You can now run 'letsencrypt --help'."
|
echo "You can now run 'letsencrypt --help'."
|
||||||
|
|||||||
+5
-5
@@ -73,7 +73,7 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "Updating letsencrypt and virtual environment dependencies..."
|
printf "Updating letsencrypt and virtual environment dependencies..."
|
||||||
if [ "$VERBOSE" = 1 ] ; then
|
if [ "$VERBOSE" = 1 ] ; then
|
||||||
echo
|
echo
|
||||||
$VENV_BIN/pip install -U setuptools
|
$VENV_BIN/pip install -U setuptools
|
||||||
@@ -86,15 +86,15 @@ if [ "$VERBOSE" = 1 ] ; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
$VENV_BIN/pip install -U setuptools > /dev/null
|
$VENV_BIN/pip install -U setuptools > /dev/null
|
||||||
echo -n .
|
printf .
|
||||||
$VENV_BIN/pip install -U pip > /dev/null
|
$VENV_BIN/pip install -U pip > /dev/null
|
||||||
echo -n .
|
printf .
|
||||||
# nginx is buggy / disabled for now...
|
# nginx is buggy / disabled for now...
|
||||||
$VENV_BIN/pip install -U letsencrypt > /dev/null
|
$VENV_BIN/pip install -U letsencrypt > /dev/null
|
||||||
echo -n .
|
printf .
|
||||||
$VENV_BIN/pip install -U letsencrypt-apache > /dev/null
|
$VENV_BIN/pip install -U letsencrypt-apache > /dev/null
|
||||||
if $VENV_BIN/pip freeze | grep -q letsencrypt-nginx ; then
|
if $VENV_BIN/pip freeze | grep -q letsencrypt-nginx ; then
|
||||||
echo -n .
|
printf .
|
||||||
$VENV_BIN/pip install -U letsencrypt-nginx > /dev/null
|
$VENV_BIN/pip install -U letsencrypt-nginx > /dev/null
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ Are you OK with your IP being logged?
|
|||||||
CMD_TEMPLATE = """\
|
CMD_TEMPLATE = """\
|
||||||
mkdir -p {root}/public_html/{response.URI_ROOT_PATH}
|
mkdir -p {root}/public_html/{response.URI_ROOT_PATH}
|
||||||
cd {root}/public_html
|
cd {root}/public_html
|
||||||
echo -n {validation} > {response.URI_ROOT_PATH}/{encoded_token}
|
printf "%s" {validation} > {response.URI_ROOT_PATH}/{encoded_token}
|
||||||
# run only once per server:
|
# run only once per server:
|
||||||
$(command -v python2 || command -v python2.7 || command -v python2.6) -c \\
|
$(command -v python2 || command -v python2.7 || command -v python2.6) -c \\
|
||||||
"import BaseHTTPServer, SimpleHTTPServer; \\
|
"import BaseHTTPServer, SimpleHTTPServer; \\
|
||||||
@@ -142,15 +142,14 @@ s.serve_forever()" """
|
|||||||
ct=response.CONTENT_TYPE, port=port)
|
ct=response.CONTENT_TYPE, port=port)
|
||||||
if self.conf("test-mode"):
|
if self.conf("test-mode"):
|
||||||
logger.debug("Test mode. Executing the manual command: %s", command)
|
logger.debug("Test mode. Executing the manual command: %s", command)
|
||||||
# sh shipped with OS X does't support echo -n
|
# sh shipped with OS X does't support echo -n, but supports printf
|
||||||
executable = "/bin/bash" if sys.platform == "darwin" else None
|
|
||||||
try:
|
try:
|
||||||
self._httpd = subprocess.Popen(
|
self._httpd = subprocess.Popen(
|
||||||
command,
|
command,
|
||||||
# don't care about setting stdout and stderr,
|
# don't care about setting stdout and stderr,
|
||||||
# we're in test mode anyway
|
# we're in test mode anyway
|
||||||
shell=True,
|
shell=True,
|
||||||
executable=executable,
|
executable=None,
|
||||||
# "preexec_fn" is UNIX specific, but so is "command"
|
# "preexec_fn" is UNIX specific, but so is "command"
|
||||||
preexec_fn=os.setsid)
|
preexec_fn=os.setsid)
|
||||||
except OSError as error: # ValueError should not happen!
|
except OSError as error: # ValueError should not happen!
|
||||||
|
|||||||
Reference in New Issue
Block a user