#!/bin/bash# Copyright (c) Jupyter Development Team.# Distributed under the terms of the Modified BSD License.source activate beakerxset -e# Handle special flags if we're rootif [ $UID == 0 ] ; then# Change UID of NB_USER to NB_UID if it does not matchif [ "$NB_UID" != $(id -u $NB_USER) ] ; thenecho "Set user UID to: $NB_UID"usermod -u $NB_UID $NB_USER# Careful: $HOME might resolve to /root depending on how the# container is started. Use the $NB_USER home path explicitly.for d in "$CONDA_DIR" "$JULIA_PKGDIR" "/home/$NB_USER"; doif [[ ! -z "$d" && -d "$d" ]]; thenecho "Set ownership to uid $NB_UID: $d"chown -R $NB_UID "$d"fidonefi# Change GID of NB_USER to NB_GID if NB_GID is passed as a parameterif [ "$NB_GID" ] ; thenecho "Change GID to $NB_GID"groupmod -g $NB_GID -o $(id -g -n $NB_USER)fi# Enable sudo if requestedif [ ! -z "$GRANT_SUDO" ]; then# Ensure includedir sudoers.d is not commentedsed -i -E 's|^#(includedir /etc/sudoers.d.*)|1円|g' /etc/sudoersecho "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebookfi# Exec the command as NB_USERecho "Execute the command as $NB_USER"exec su $NB_USER -c "env PATH=$PATH$*"else# Exec the commandecho "Execute the command"exec $*fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。