Skip to content

Commit 35b38bc

Browse files
committed
Fix scripts populate.sh and start.sh
- This partly reverts commit 0f91f4142ed73763a2b71f4589b4b5f214908122
1 parent 061e622 commit 35b38bc

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

base/scripts/usr/local/bin/start-notebook.d/populate.sh

+4-13
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,10 @@ set -e
66

77
if [ "$(ls -A "/home/jovyan" 2> /dev/null)" == "" ]; then
88
_log "Populating home dir /home/jovyan..."
9-
if [ "$(id -u)" == 0 ] ; then
10-
if su $NB_USER -c "cp -a /var/backups/skel/. /home/jovyan"; then
11-
_log "Success!"
12-
else
13-
_log "Failed to copy data from /var/backups/skel to /home/jovyan!"
14-
exit 1
15-
fi
9+
if cp -a /var/backups/skel/. /home/jovyan; then
10+
_log "Success!"
1611
else
17-
if cp -a /var/backups/skel/. /home/jovyan; then
18-
_log "Success!"
19-
else
20-
_log "Failed to copy data from /var/backups/skel to /home/jovyan!"
21-
exit 1
22-
fi
12+
_log "Failed to copy data from /var/backups/skel to /home/jovyan!"
13+
exit 1
2314
fi
2415
fi

base/scripts/usr/local/bin/start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ if [ "$(id -u)" == 0 ] ; then
128128
# The home directory could be bind mounted. Populate it if it is empty
129129
elif [[ "$(ls -A "/home/${NB_USER}" 2> /dev/null)" == "" ]]; then
130130
_log "Populating home dir /home/${NB_USER}..."
131-
if su $NB_USER -c "cp -a /home/jovyan/. /home/${NB_USER}/"; then
131+
if cp -a /home/jovyan/. "/home/${NB_USER}/"; then
132132
_log "Success!"
133133
else
134134
_log "Failed to copy data from /home/jovyan to /home/${NB_USER}!"

0 commit comments

Comments
 (0)