forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwait-tunnel.sh
More file actions
executable file
·39 lines (31 loc) · 886 Bytes
/
Copy pathwait-tunnel.sh
File metadata and controls
executable file
·39 lines (31 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
TUNNEL_LOG="$LOGS_DIR/browserstack-tunnel.log"
# Method that prints the logfile output of the browserstack tunnel.
printLog() {
echo "Logfile output of Browserstack tunnel (${TUNNEL_LOG}):"
echo ""
cat ${TUNNEL_LOG}
}
# Wait for Connect to be ready before exiting
# Time out if we wait for more than 2 minutes, so the process won't run forever.
let "counter=0"
# Exit the process if there are errors reported. Print the tunnel log to the console.
if [ -f $BROWSER_PROVIDER_ERROR_FILE ]; then
echo
echo "An error occurred while starting the tunnel. See error:"
printLog
exit 5
fi
while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
let "counter++"
if [ $counter -gt 240 ]; then
echo
echo "Timed out after 2 minutes waiting for tunnel ready file"
printLog
exit 5
fi
printf "."
sleep .5
done
echo ""
echo "Connected to Browserstack"