You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 30, 2021. It is now read-only.
echo"FATAL: SELENIUM_HUB_PORT is empty but should be a number"1>&2
97
+
exit 120
98
+
fi
99
+
100
+
# TODO: Remove this duplicated logic
101
+
if [ "${SELENIUM_HUB_PORT}"="0" ];then
102
+
export SELENIUM_HUB_PORT=$(get_unused_port)
103
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
104
+
# User want to pick random ports but may also want to fix some others
105
+
if [ "${SELENIUM_HUB_PORT}"="${DEFAULT_SELENIUM_HUB_PORT}" ];then
106
+
export SELENIUM_HUB_PORT=$(get_unused_port)
107
+
fi
108
+
fi
109
+
110
+
if [ "${SELENIUM_NODE_CH_PORT}"="0" ];then
111
+
export SELENIUM_NODE_CH_PORT=$(get_unused_port)
112
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
113
+
# User want to pick random ports but may also want to fix some others
114
+
if [ "${SELENIUM_NODE_CH_PORT}"="${DEFAULT_SELENIUM_NODE_CH_PORT}" ];then
115
+
export SELENIUM_NODE_CH_PORT=$(get_unused_port)
116
+
fi
117
+
fi
118
+
119
+
if [ "${SELENIUM_NODE_FF_PORT}"="0" ];then
120
+
export SELENIUM_NODE_FF_PORT=$(get_unused_port)
121
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
122
+
# User want to pick random ports but may also want to fix some others
123
+
if [ "${SELENIUM_NODE_FF_PORT}"="${DEFAULT_SELENIUM_NODE_FF_PORT}" ];then
124
+
export SELENIUM_NODE_FF_PORT=$(get_unused_port)
125
+
fi
126
+
fi
127
+
128
+
if [ "${VNC_PORT}"="0" ];then
129
+
export VNC_PORT=$(get_unused_port)
130
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
131
+
# User want to pick random ports but may also want to fix some others
132
+
if [ "${VNC_PORT}"="${DEFAULT_VNC_PORT}" ];then
133
+
export VNC_PORT=$(get_unused_port)
134
+
fi
135
+
fi
136
+
137
+
if [ "${NOVNC_PORT}"="0" ];then
138
+
export NOVNC_PORT=$(get_unused_port)
139
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
140
+
# User want to pick random ports but may also want to fix some others
141
+
if [ "${NOVNC_PORT}"="${DEFAULT_NOVNC_PORT}" ];then
142
+
export NOVNC_PORT=$(get_unused_port)
143
+
fi
144
+
fi
145
+
146
+
if [ "${SSHD_PORT}"="0" ];then
147
+
export SSHD_PORT=$(get_unused_port)
148
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
149
+
# User want to pick random ports but may also want to fix some others
150
+
if [ "${SSHD_PORT}"="${DEFAULT_SSHD_PORT}" ];then
151
+
export SSHD_PORT=$(get_unused_port)
152
+
fi
153
+
fi
154
+
155
+
if [ "${SAUCE_LOCAL_SEL_PORT}"="0" ];then
156
+
export SAUCE_LOCAL_SEL_PORT=$(get_unused_port)
157
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
158
+
# User want to pick random ports but may also want to fix some others
159
+
if [ "${SAUCE_LOCAL_SEL_PORT}"="${DEFAULT_SAUCE_LOCAL_SEL_PORT}" ];then
160
+
export SAUCE_LOCAL_SEL_PORT=$(get_unused_port)
161
+
fi
162
+
fi
163
+
164
+
if [ "${SUPERVISOR_HTTP_PORT}"="0" ];then
165
+
export SUPERVISOR_HTTP_PORT=$(get_unused_port)
166
+
elif [ "${PICK_ALL_RANDMON_PORTS}"="true" ];then
167
+
# User want to pick random ports but may also want to fix some others
168
+
if [ "${SUPERVISOR_HTTP_PORT}"="${DEFAULT_SUPERVISOR_HTTP_PORT}" ];then
169
+
export SUPERVISOR_HTTP_PORT=$(get_unused_port)
170
+
fi
171
+
fi
172
+
173
+
#----------------------------------------
174
+
# Remove lock files, thanks @garagepoort
175
+
clear_x_locks.sh
176
+
177
+
#--------------------------------
178
+
# Improve etc/hosts and fix dirs
179
+
improve_etc_hosts.sh
180
+
fix_dirs.sh
181
+
182
+
#-------------------------
183
+
# Docker alongside docker
184
+
docker_alongside_docker.sh
185
+
95
186
#----------------------------------------
96
187
# Fix autoassigned ports
97
188
#----------------------------------------
@@ -109,13 +200,13 @@ function get_free_display() {
109
200
# -s file is not zero size
110
201
if [ -s /tmp/netstatX11.log ];then
111
202
# important: while loops are executed in a subshell
112
-
# var assignments will be lost unless using <<<
113
-
#while true ; do
114
-
# let find_display_num=${find_display_num}+1
203
+
#var assignments will be lost unless using <<<
204
+
#using 11.0 12.3 1.8 and so on didn't work, left as a reference
205
+
#local pythonCmd="from random import shuffle;list1 = list(range($MAX_DISPLAY_SEARCH));shuffle(list1);list2 = [x/10 for x in list1];str_res = ' '.join(str(e) for e in list2);print (str_res)"
115
206
local pythonCmd="from random import shuffle;list1 = list(range($MAX_DISPLAY_SEARCH));shuffle(list1);print (' '.join(str(e) for e in list1))"
116
207
local displayNums=$(python -c "${pythonCmd}")
117
208
# Always find a free DISPLAY port starting with current DISP_N if it was provided
0 commit comments