Parcourir la source

Move display increment to function

bryan il y a 2 ans
Parent
commit
642bb7218f
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6 2
      installJRMC

+ 6 - 2
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"