mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-18 20:27:57 +00:00
fix: devcontainer utils.sh ssh copy improvements (#3372)
fix utils.sh - use HOME variable, permissions and logging Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
parent
75ef6ccf1e
commit
99b57b321b
@ -32,19 +32,22 @@ config_remote() {
|
||||
}
|
||||
|
||||
# Setup special .ssh files
|
||||
#
|
||||
# Prints out lines of text to make things pretty
|
||||
# Param 1: bash array, filenames relative to the customization directory that should be copied to ~/.ssh
|
||||
setup_ssh() {
|
||||
mkdir -p ~/.ssh
|
||||
echo "starting ~/.ssh directory setup..."
|
||||
mkdir -p "${HOME}.ssh"
|
||||
chmod 0700 "${HOME}/.ssh"
|
||||
echo "-----"
|
||||
local files=("$@")
|
||||
for file in "${files[@]}" ; do
|
||||
local cfile="/devcontainer-customization/${file}"
|
||||
local hfile="~/.ssh/${file}"
|
||||
local hfile="${HOME}/.ssh/${file}"
|
||||
if [ ! -f "${hfile}" ]; then
|
||||
echo "copying ${file}"
|
||||
echo "copying \"${file}\""
|
||||
cp "${cfile}" "${hfile}"
|
||||
chmod 600 "${hfile}"
|
||||
fi
|
||||
done
|
||||
ls ~/.ssh
|
||||
echo "~/.ssh directory setup complete!"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user