Home folder can be empty, so copying default bash settings (#3897)

This commit is contained in:
Andrei Kondratiev 2022-09-06 23:11:53 +03:00 committed by GitHub
parent 30ce62b5b4
commit f5ba90b963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,14 @@ resource "coder_agent" "main" {
startup_script = <<EOT
#!/bin/bash
# home folder can be empty, so copying default bash settings
if [ ! -f ~/.profile ]; then
cp /etc/skel/.profile $HOME
fi
if [ ! -f ~/.bashrc ]; then
cp /etc/skel/.bashrc $HOME
fi
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
code-server --auth none --port 13337 | tee code-server-install.log &