-
Notifications
You must be signed in to change notification settings - Fork 86
should override PORT #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
should override PORT #606
Changes from 4 commits
50298c6
ed54aa9
d9807e0
1e78f97
cf3fbed
582adaa
469f1cd
6bc4558
e39a012
484936a
b88d30a
9561764
97d3340
d59ed92
ec95aae
24919cf
b26906f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -292,11 +292,11 @@ VNC_LOG="/tmp/kasmvncserver.log" | |||||||||||||||||||||||||||||||||||
| printf "🚀 Starting KasmVNC server...\n" | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| set +e | ||||||||||||||||||||||||||||||||||||
| kasmvncserver -select-de "${DESKTOP_ENVIRONMENT}" -disableBasicAuth > "$VNC_LOG" 2>&1 | ||||||||||||||||||||||||||||||||||||
| kasmvncserver -select-de "${DESKTOP_ENVIRONMENT}" -websocketPort "${PORT}" -disableBasicAuth > "$VNC_LOG" 2>&1 | ||||||||||||||||||||||||||||||||||||
| RETVAL=$? | ||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| if [[ $RETVAL -ne 0 ]]; then | ||||||||||||||||||||||||||||||||||||
| if [[ $RETVAL -ne 0 ]] && ! curl -s http://127.0.0.1:"${PORT}"/app; then | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| if [[ $RETVAL -ne 0 ]] && ! curl -s http://127.0.0.1:"${PORT}"/app; then | |
| # Retry health check up to 10 times with 1s delay | |
| health_check_with_retries() { | |
| local url=$1 | |
| local max_attempts=10 | |
| local attempt=1 | |
| while (( attempt <= max_attempts )); do | |
| if curl -s "$url" > /dev/null; then | |
| return 0 | |
| fi | |
| sleep 1 | |
| ((attempt++)) | |
| done | |
| return 1 | |
| } | |
| if [[ $RETVAL -ne 0 ]] && ! health_check_with_retries "http://127.0.0.1:${PORT}/app"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The curl command is used without checking if it's available. The script already has a download_file function that handles multiple download tools (curl, wget, busybox) as fallbacks. If curl is not available on the system, this health check will fail even if the server started successfully. Consider using a similar fallback pattern or checking for curl availability before using it.