mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-24 02:43:01 +01:00
Compare commits
1 Commits
fix/frigat
...
fix/coder-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c7fb75f6d |
@@ -89,26 +89,31 @@ VERSION=$(curl -fsSL https://api.github.com/repos/coder/code-server/releases/lat
|
|||||||
awk '{print substr($2, 3, length($2)-4) }')
|
awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
|
||||||
msg_info "Installing Code-Server v${VERSION}"
|
msg_info "Installing Code-Server v${VERSION}"
|
||||||
|
config_path="${HOME}/.config/code-server/config.yaml"
|
||||||
|
preexisting_config=false
|
||||||
|
|
||||||
if [ -f ~/.config/code-server/config.yaml ]; then
|
if [ -f "$config_path" ]; then
|
||||||
existing_config=true
|
preexisting_config=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -fOL https://github.com/coder/code-server/releases/download/v"$VERSION"/code-server_"${VERSION}"_amd64.deb &>/dev/null
|
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
|
dpkg -i code-server_"${VERSION}"_amd64.deb &>/dev/null
|
||||||
rm -rf code-server_"${VERSION}"_amd64.deb
|
rm -rf code-server_"${VERSION}"_amd64.deb
|
||||||
mkdir -p ~/.config/code-server/
|
mkdir -p "${HOME}/.config/code-server/"
|
||||||
systemctl enable -q --now code-server@"$USER"
|
|
||||||
|
|
||||||
if [ $existing_config = false ]; then
|
if [ "$preexisting_config" = false ]; then
|
||||||
cat <<EOF >~/.config/code-server/config.yaml
|
cat <<EOF >"$config_path"
|
||||||
bind-addr: 0.0.0.0:8680
|
bind-addr: 0.0.0.0:8680
|
||||||
auth: none
|
auth: none
|
||||||
password:
|
password:
|
||||||
cert: false
|
cert: false
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
systemctl enable -q --now code-server@"$USER"
|
||||||
systemctl restart code-server@"$USER"
|
systemctl restart code-server@"$USER"
|
||||||
|
if ! systemctl is-active --quiet code-server@"$USER"; then
|
||||||
|
error_exit "code-server service failed to start."
|
||||||
|
fi
|
||||||
msg_ok "Installed Code-Server v${VERSION} on $hostname"
|
msg_ok "Installed Code-Server v${VERSION} on $hostname"
|
||||||
|
|
||||||
echo -e "${APP} should be reachable by going to the following URL.
|
echo -e "${APP} should be reachable by going to the following URL.
|
||||||
|
|||||||
Reference in New Issue
Block a user