Skip to content

Commit 99b57b3

Browse files
authored
fix: devcontainer utils.sh ssh copy improvements (#3372)
fix utils.sh - use HOME variable, permissions and logging Signed-off-by: Dave Lee <[email protected]>
1 parent 75ef6cc commit 99b57b3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.devcontainer-scripts/utils.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,22 @@ config_remote() {
3232
}
3333

3434
# Setup special .ssh files
35-
#
35+
# Prints out lines of text to make things pretty
3636
# Param 1: bash array, filenames relative to the customization directory that should be copied to ~/.ssh
3737
setup_ssh() {
38-
mkdir -p ~/.ssh
38+
echo "starting ~/.ssh directory setup..."
39+
mkdir -p "${HOME}.ssh"
40+
chmod 0700 "${HOME}/.ssh"
41+
echo "-----"
3942
local files=("$@")
4043
for file in "${files[@]}" ; do
4144
local cfile="/devcontainer-customization/${file}"
42-
local hfile="~/.ssh/${file}"
45+
local hfile="${HOME}/.ssh/${file}"
4346
if [ ! -f "${hfile}" ]; then
44-
echo "copying ${file}"
47+
echo "copying \"${file}\""
4548
cp "${cfile}" "${hfile}"
4649
chmod 600 "${hfile}"
4750
fi
4851
done
49-
ls ~/.ssh
52+
echo "~/.ssh directory setup complete!"
5053
}

0 commit comments

Comments
 (0)