Rename to base-notebook

(c) Copyright IBM Corp. 2016
This commit is contained in:
Peter Parente
2016-05-18 22:11:34 -04:00
parent b9ff1d25b1
commit 839e8307b6
9 changed files with 8 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Handle special flags if we're root
if [ $UID == 0 ] ; then
# Change UID of NB_USER to NB_UID if it does not match
if [ "$NB_UID" != $(id -u $NB_USER) ] ; then
usermod -u $NB_UID $NB_USER
chown -R $NB_UID $CONDA_DIR
fi
# Enable sudo if requested
if [ ! -z "$GRANT_SUDO" ]; then
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook
fi
# Start the notebook server
exec su $NB_USER -c "env PATH=$PATH jupyter notebook $*"
else
# Otherwise just exec the notebook
exec jupyter notebook $*
fi