diff options
author | crupest <crupest@outlook.com> | 2024-08-15 00:08:43 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2024-08-15 00:08:43 +0800 |
commit | 0dc32c4f8da4f0f52e857775aa240eb3ddca0e9c (patch) | |
tree | 09504e7755b7803e518baaa11d255f35ed6c9817 /docker/crupest-debian-dev/bootstrap/bash-profile/code-server.bash | |
parent | bb241f176557341187575c5d74049d4e358d7cd3 (diff) | |
parent | f7c13845654289838cd933b2156abd6e7ae575a5 (diff) | |
download | crupest-0dc32c4f8da4f0f52e857775aa240eb3ddca0e9c.tar.gz crupest-0dc32c4f8da4f0f52e857775aa240eb3ddca0e9c.tar.bz2 crupest-0dc32c4f8da4f0f52e857775aa240eb3ddca0e9c.zip |
Merge branch 'debian-dev'
Diffstat (limited to 'docker/crupest-debian-dev/bootstrap/bash-profile/code-server.bash')
-rw-r--r-- | docker/crupest-debian-dev/bootstrap/bash-profile/code-server.bash | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docker/crupest-debian-dev/bootstrap/bash-profile/code-server.bash b/docker/crupest-debian-dev/bootstrap/bash-profile/code-server.bash new file mode 100644 index 0000000..fd88d15 --- /dev/null +++ b/docker/crupest-debian-dev/bootstrap/bash-profile/code-server.bash @@ -0,0 +1,15 @@ +export CODE_SERVER_CONFIG="/data/code-server-config.yaml" + +CODE_SERVER_PROGRAM=code-server +CODE_SERVER_PORT=8080 + +if which "$CODE_SERVER_PROGRAM" > /dev/null 2>&1; then + if ! pgrep -f "$CODE_SERVER_PROGRAM" > /dev/null 2>&1; then + echo "code-server is not running, starting..." + mkdir -p ~/.local/share/code-server + "$CODE_SERVER_PROGRAM" "--bind-addr" "0.0.0.0:$CODE_SERVER_PORT" \ + > ~/.local/share/code-server/log 2> ~/.local/share/code-server/error & + fi +else + echo "code-server not found, skipping code-server setup." +fi |