mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-02 08:43:10 +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
|
# 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
|
# Param 1: bash array, filenames relative to the customization directory that should be copied to ~/.ssh
|
||||||
setup_ssh() {
|
setup_ssh() {
|
||||||
mkdir -p ~/.ssh
|
echo "starting ~/.ssh directory setup..."
|
||||||
|
mkdir -p "${HOME}.ssh"
|
||||||
|
chmod 0700 "${HOME}/.ssh"
|
||||||
|
echo "-----"
|
||||||
local files=("$@")
|
local files=("$@")
|
||||||
for file in "${files[@]}" ; do
|
for file in "${files[@]}" ; do
|
||||||
local cfile="/devcontainer-customization/${file}"
|
local cfile="/devcontainer-customization/${file}"
|
||||||
local hfile="~/.ssh/${file}"
|
local hfile="${HOME}/.ssh/${file}"
|
||||||
if [ ! -f "${hfile}" ]; then
|
if [ ! -f "${hfile}" ]; then
|
||||||
echo "copying ${file}"
|
echo "copying \"${file}\""
|
||||||
cp "${cfile}" "${hfile}"
|
cp "${cfile}" "${hfile}"
|
||||||
chmod 600 "${hfile}"
|
chmod 600 "${hfile}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
ls ~/.ssh
|
echo "~/.ssh directory setup complete!"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user