|
128 | 128 |
|
129 | 129 | # TODO: Remove this duplicated logic |
130 | 130 | if [ "${SELENIUM_HUB_PORT}" = "0" ]; then |
131 | | - export SELENIUM_HUB_PORT=$(get_unused_port) |
| 131 | + export SELENIUM_HUB_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
132 | 132 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
133 | 133 | # User want to pick random ports but may also want to fix some others |
134 | 134 | if [ "${SELENIUM_HUB_PORT}" = "${DEFAULT_SELENIUM_HUB_PORT}" ]; then |
135 | | - export SELENIUM_HUB_PORT=$(get_unused_port) |
| 135 | + export SELENIUM_HUB_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
136 | 136 | fi |
137 | 137 | fi |
138 | 138 |
|
139 | 139 | if [ "${SELENIUM_NODE_CH_PORT}" = "0" ]; then |
140 | | - export SELENIUM_NODE_CH_PORT=$(get_unused_port) |
| 140 | + export SELENIUM_NODE_CH_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
141 | 141 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
142 | 142 | # User want to pick random ports but may also want to fix some others |
143 | 143 | if [ "${SELENIUM_NODE_CH_PORT}" = "${DEFAULT_SELENIUM_NODE_CH_PORT}" ]; then |
144 | | - export SELENIUM_NODE_CH_PORT=$(get_unused_port) |
| 144 | + export SELENIUM_NODE_CH_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
145 | 145 | fi |
146 | 146 | fi |
147 | 147 |
|
148 | 148 | if [ "${SELENIUM_NODE_FF_PORT}" = "0" ]; then |
149 | | - export SELENIUM_NODE_FF_PORT=$(get_unused_port) |
| 149 | + export SELENIUM_NODE_FF_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
150 | 150 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
151 | 151 | # User want to pick random ports but may also want to fix some others |
152 | 152 | if [ "${SELENIUM_NODE_FF_PORT}" = "${DEFAULT_SELENIUM_NODE_FF_PORT}" ]; then |
153 | | - export SELENIUM_NODE_FF_PORT=$(get_unused_port) |
| 153 | + export SELENIUM_NODE_FF_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
154 | 154 | fi |
155 | 155 | fi |
156 | 156 |
|
157 | 157 | if [ "${SELENIUM_NODE_RC_CH_PORT}" = "0" ]; then |
158 | | - export SELENIUM_NODE_RC_CH_PORT=$(get_unused_port) |
| 158 | + export SELENIUM_NODE_RC_CH_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
159 | 159 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
160 | 160 | # User want to pick random ports but may also want to fix some others |
161 | 161 | if [ "${SELENIUM_NODE_RC_CH_PORT}" = "${DEFAULT_SELENIUM_NODE_RC_CH_PORT}" ]; then |
162 | | - export SELENIUM_NODE_RC_CH_PORT=$(get_unused_port) |
| 162 | + export SELENIUM_NODE_RC_CH_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
163 | 163 | fi |
164 | 164 | fi |
165 | 165 |
|
166 | 166 | if [ "${SELENIUM_NODE_RC_FF_PORT}" = "0" ]; then |
167 | | - export SELENIUM_NODE_RC_FF_PORT=$(get_unused_port) |
| 167 | + export SELENIUM_NODE_RC_FF_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
168 | 168 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
169 | 169 | # User want to pick random ports but may also want to fix some others |
170 | 170 | if [ "${SELENIUM_NODE_RC_FF_PORT}" = "${DEFAULT_SELENIUM_NODE_RC_FF_PORT}" ]; then |
171 | | - export SELENIUM_NODE_RC_FF_PORT=$(get_unused_port) |
| 171 | + export SELENIUM_NODE_RC_FF_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
172 | 172 | fi |
173 | 173 | fi |
174 | 174 |
|
@@ -199,11 +199,11 @@ if [ "${VNC_START}" = "true" ]; then |
199 | 199 | export VNC_PORT=$(get_unused_port_from_range ${VNC_FROM_PORT} ${VNC_TO_PORT}) |
200 | 200 | else |
201 | 201 | if [ "${VNC_PORT}" = "0" ]; then |
202 | | - export VNC_PORT=$(get_unused_port) |
| 202 | + export VNC_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
203 | 203 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
204 | 204 | # User want to pick random ports but may also want to fix some others |
205 | 205 | if [ "${VNC_PORT}" = "${DEFAULT_VNC_PORT}" ]; then |
206 | | - export VNC_PORT=$(get_unused_port) |
| 206 | + export VNC_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
207 | 207 | fi |
208 | 208 | fi |
209 | 209 | fi |
|
213 | 213 |
|
214 | 214 |
|
215 | 215 | if [ "${NOVNC_PORT}" = "0" ]; then |
216 | | - export NOVNC_PORT=$(get_unused_port) |
| 216 | + export NOVNC_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
217 | 217 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
218 | 218 | # User want to pick random ports but may also want to fix some others |
219 | 219 | if [ "${NOVNC_PORT}" = "${DEFAULT_NOVNC_PORT}" ]; then |
220 | | - export NOVNC_PORT=$(get_unused_port) |
| 220 | + export NOVNC_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
221 | 221 | fi |
222 | 222 | fi |
223 | 223 |
|
224 | 224 | if [ "${SAUCE_LOCAL_SEL_PORT}" = "0" ]; then |
225 | | - export SAUCE_LOCAL_SEL_PORT=$(get_unused_port) |
| 225 | + export SAUCE_LOCAL_SEL_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
226 | 226 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
227 | 227 | # User want to pick random ports but may also want to fix some others |
228 | 228 | if [ "${SAUCE_LOCAL_SEL_PORT}" = "${DEFAULT_SAUCE_LOCAL_SEL_PORT}" ]; then |
229 | | - export SAUCE_LOCAL_SEL_PORT=$(get_unused_port) |
| 229 | + export SAUCE_LOCAL_SEL_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
230 | 230 | fi |
231 | 231 | fi |
232 | 232 |
|
233 | 233 | if [ "${SUPERVISOR_HTTP_PORT}" = "0" ]; then |
234 | | - export SUPERVISOR_HTTP_PORT=$(get_unused_port) |
| 234 | + export SUPERVISOR_HTTP_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
235 | 235 | elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then |
236 | 236 | # User want to pick random ports but may also want to fix some others |
237 | 237 | if [ "${SUPERVISOR_HTTP_PORT}" = "${DEFAULT_SUPERVISOR_HTTP_PORT}" ]; then |
238 | | - export SUPERVISOR_HTTP_PORT=$(get_unused_port) |
| 238 | + export SUPERVISOR_HTTP_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO}) |
239 | 239 | fi |
240 | 240 | fi |
241 | 241 |
|
|
0 commit comments