Move display increment to function

This commit is contained in:
2023-03-24 19:22:45 -04:00
parent 319ee077aa
commit 642bb7218f

View File

@@ -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"