Commit 0c68990e authored by Peter Parente's avatar Peter Parente Committed by GitHub

Merge pull request #425 from minrk/warn-ignored-config

warn about unused config
parents 2a0a74fc e91827d3
...@@ -30,7 +30,8 @@ if [ $(id -u) == 0 ] ; then ...@@ -30,7 +30,8 @@ if [ $(id -u) == 0 ] ; then
fi fi
# Enable sudo if requested # Enable sudo if requested
if [ ! -z "$GRANT_SUDO" ]; then if [ "$GRANT_SUDO" == "1" || "$GRANT_SUDO" == 'yes' ]; then
echo "Granting $NB_USER sudo access"
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook
fi fi
...@@ -38,6 +39,15 @@ if [ $(id -u) == 0 ] ; then ...@@ -38,6 +39,15 @@ if [ $(id -u) == 0 ] ; then
echo "Execute the command as $NB_USER" echo "Execute the command as $NB_USER"
exec su $NB_USER -c "env PATH=$PATH $*" exec su $NB_USER -c "env PATH=$PATH $*"
else else
if [[ ! -z "$NB_UID" && "$NB_UID" != "$(id -u)" ]]; then
echo 'Container must be run as root to set $NB_UID'
fi
if [[ ! -z "$NB_GID" && "$NB_GID" != "$(id -g)" ]]; then
echo 'Container must be run as root to set $NB_GID'
fi
if [ "$GRANT_SUDO" == "1" || "$GRANT_SUDO" == 'yes' ]; then
echo 'Container must be run as root to grant sudo permissions'
fi
# Exec the command # Exec the command
echo "Execute the command" echo "Execute the command"
exec $* exec $*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment