From e11f31a7b6480f96e5e962b357ca2acc4c8167a2 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 6 Apr 2020 10:08:08 +0200 Subject: [PATCH] start-notebook.sh: pass NOTEBOOK_ARGS as docs say --- base-notebook/start-notebook.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/base-notebook/start-notebook.sh b/base-notebook/start-notebook.sh index 9d33dbd5..08f32e4b 100755 --- a/base-notebook/start-notebook.sh +++ b/base-notebook/start-notebook.sh @@ -4,19 +4,22 @@ set -e +if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then + echo "WARNING: use start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub." + exec /usr/local/bin/start-singleuser.sh "$@" + exit +fi + wrapper="" if [[ "${RESTARTABLE}" == "yes" ]]; then wrapper="run-one-constantly" fi -if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then - # launched by JupyterHub, use single-user entrypoint - exec /usr/local/bin/start-singleuser.sh "$@" -elif [[ -n "${JUPYTER_ENABLE_LAB}" ]]; then - # shellcheck disable=SC1091 - . /usr/local/bin/start.sh ${wrapper} jupyter lab "$@" +if [[ -n "${JUPYTER_ENABLE_LAB}" ]]; then + # shellcheck disable=SC1091,SC2086 + exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter lab "$@" else echo "WARN: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice." - # shellcheck disable=SC1091 - . /usr/local/bin/start.sh ${wrapper} jupyter notebook "$@" + # shellcheck disable=SC1091,SC2086 + exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter notebook "$@" fi