mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-12 03:59:12 +01:00
Check if config file exists
This commit is contained in:
@@ -89,17 +89,26 @@ VERSION=$(curl -fsSL https://api.github.com/repos/coder/code-server/releases/lat
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
msg_info "Installing Code-Server v${VERSION}"
|
||||
|
||||
|
||||
if [ -f ~/.config/code-server/config.yaml ]; then
|
||||
existing_config = true
|
||||
fi
|
||||
|
||||
curl -fOL https://github.com/coder/code-server/releases/download/v"$VERSION"/code-server_"${VERSION}"_amd64.deb &>/dev/null
|
||||
dpkg -i code-server_"${VERSION}"_amd64.deb &>/dev/null
|
||||
rm -rf code-server_"${VERSION}"_amd64.deb
|
||||
mkdir -p ~/.config/code-server/
|
||||
systemctl enable -q --now code-server@"$USER"
|
||||
|
||||
if [ $existing_config = false ]; then
|
||||
cat <<EOF >~/.config/code-server/config.yaml
|
||||
bind-addr: 0.0.0.0:8680
|
||||
auth: none
|
||||
password:
|
||||
cert: false
|
||||
EOF
|
||||
fi
|
||||
systemctl restart code-server@"$USER"
|
||||
msg_ok "Installed Code-Server v${VERSION} on $hostname"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user