From 642bb7218f68783bde4479a40dfb350084da318f Mon Sep 17 00:00:00 2001 From: bryan Date: Fri, 24 Mar 2023 19:22:45 -0400 Subject: [PATCH] Move display increment to function --- installJRMC | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/installJRMC b/installJRMC index e8e5b2f..f16a697 100755 --- a/installJRMC +++ b/installJRMC @@ -1354,8 +1354,12 @@ service_jriver-xvnc() { if ! "${ENABLE[@]}" "$SERVICE_NAME"; then err "vncserver failed to start on DISPLAY $NEXT_DISPLAY" err "Incrementing DISPLAY and retrying" - service_jriver-xvnc - return + # Allow to increment 10 times before breaking + max=$(( DISPLAYNUM + 10 )) + while [[ $NEXT_DISPLAYNUM -lt $max ]]; do + service_jriver-xvnc + done + return 1 else echo "Xvnc running on localhost:$PORT" openFirewall "jriver-xvnc" "$PORT/tcp"