Skip to content

Commit

Permalink
Fix scripts populate.sh and start.sh
Browse files Browse the repository at this point in the history
- This partly reverts commit 0f91f4142ed73763a2b71f4589b4b5f214908122
  • Loading branch information
benz0li committed Mar 20, 2023
1 parent 061e622 commit 35b38bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions base/scripts/usr/local/bin/start-notebook.d/populate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@ set -e

if [ "$(ls -A "/home/jovyan" 2> /dev/null)" == "" ]; then
_log "Populating home dir /home/jovyan..."
if [ "$(id -u)" == 0 ] ; then
if su $NB_USER -c "cp -a /var/backups/skel/. /home/jovyan"; then
_log "Success!"
else
_log "Failed to copy data from /var/backups/skel to /home/jovyan!"
exit 1
fi
if cp -a /var/backups/skel/. /home/jovyan; then
_log "Success!"
else
if cp -a /var/backups/skel/. /home/jovyan; then
_log "Success!"
else
_log "Failed to copy data from /var/backups/skel to /home/jovyan!"
exit 1
fi
_log "Failed to copy data from /var/backups/skel to /home/jovyan!"
exit 1
fi
fi
2 changes: 1 addition & 1 deletion base/scripts/usr/local/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if [ "$(id -u)" == 0 ] ; then
# The home directory could be bind mounted. Populate it if it is empty
elif [[ "$(ls -A "/home/${NB_USER}" 2> /dev/null)" == "" ]]; then
_log "Populating home dir /home/${NB_USER}..."
if su $NB_USER -c "cp -a /home/jovyan/. /home/${NB_USER}/"; then
if cp -a /home/jovyan/. "/home/${NB_USER}/"; then
_log "Success!"
else
_log "Failed to copy data from /home/jovyan to /home/${NB_USER}!"
Expand Down

0 comments on commit 35b38bc

Please sign in to comment.