Skip to content

Commit 3083303

Browse files
authored
Update code-server.sh
1 parent 5a47ffa commit 3083303

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎tools/code-server.sh‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ find_free_port() {
1515
}
1616
PORT=$(find_free_port)
1717

18-
echo "[+] Installing code-server..."
19-
curl -fsSL https://code-server.dev/install.sh | sh
18+
# --- install only if not already installed ---
19+
if command -v code-server >/dev/null 2>&1; then
20+
echo "[+] code-server is already installed, skipping installation."
21+
else
22+
echo "[+] Installing code-server..."
23+
curl -fsSL https://code-server.dev/install.sh | sh
24+
fi
2025

2126
mkdir -p /root/.config/code-server
2227
cat >/root/.config/code-server/config.yaml <<EOF
@@ -66,7 +71,6 @@ stop_logs() {
6671
}
6772

6873
confirm_stop() {
69-
# immediately silence logs so the prompt is clean
7074
stop_logs
7175
echo
7276
read -rp "Are you sure you want to stop code-server? (y/n): " ans

0 commit comments

Comments
 (0)