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 May 9, 2018. It is now read-only.
userAgent="DigitalOcean Speed Test CLI $version - https://github.com/ZacharyDuBois/DigitalOcean-Speed-Test-CLI"
13
18
testType=$1
14
19
disallowTracking=$2
15
-
20
+
disableColor=$3
16
21
17
22
##
18
23
# Message Types
19
24
##
20
25
21
-
fail="[$(tput setaf 1) FAIL $(tput sgr0)]"
22
-
ok="[$(tput setaf 2) OK $(tput sgr0)]"
23
-
running="[$(tput setaf 3) ** $(tput sgr0)]"
24
-
notice="[$(tput setaf 3)NOTICE$(tput sgr0)]"
25
-
warn="[$(tput setaf 3) WARN $(tput sgr0)]"
26
-
info="[$(tput setaf 6) INFO $(tput sgr0)]"
27
-
finish="[$(tput setaf 4) DONE $(tput sgr0)]"
26
+
if [[ $disableColor=="" ]] || [[ $disableColor==false ]]
27
+
then
28
+
fail="[$(tput setaf 1) FAIL $(tput sgr0)]"
29
+
ok="[$(tput setaf 2) OK $(tput sgr0)]"
30
+
running="[$(tput setaf 3) ** $(tput sgr0)]"
31
+
notice="[$(tput setaf 3)NOTICE$(tput sgr0)]"
32
+
warn="[$(tput setaf 3) WARN $(tput sgr0)]"
33
+
info="[$(tput setaf 6) INFO $(tput sgr0)]"
34
+
finish="[$(tput setaf 4) DONE $(tput sgr0)]"
35
+
elif [[ $disableColor==true ]]
36
+
then
37
+
fail="[ FAIL ]"
38
+
ok="[ OK ]"
39
+
running="[ ** ]"
40
+
notice="[NOTICE]"
41
+
warn="[ WARN ]"
42
+
info="[ INFO ]"
43
+
finish="[ DONE ]"
44
+
else
45
+
echo"Unknown disableColor setting."
46
+
exit 1
47
+
fi
28
48
29
49
##
30
50
# Startup Checks
@@ -62,9 +82,6 @@ echo
62
82
# Download Test
63
83
##
64
84
65
-
echo"$info All test files are not saved so you don't have to worry about disk space :P"
66
-
echo"$running Starting download speedtest..."
67
-
68
85
# Determine the testType.
69
86
if [[ $testType=="100mb" ]] || [[ $testType=="" ]]
70
87
then
@@ -90,16 +107,17 @@ then
90
107
echo"$fail You need curl to enable tracking."
91
108
exit 1
92
109
fi
93
-
echo"$noticeYou have selected not to opt out of tracking. Tracking only counts the number of tests and the test type (and the IP will be logged in the access log, etc)."
94
-
echo"$notice The tracking URL is not called until the very end of the test. If you would like to optout now, you can simply cancel this script and re-run it with the disallowTracking variable set. See README.md on Github for more information."
110
+
echo"$noticeBy default, you are opted-in for just basic tracking (Which test type you picked)."
111
+
echo"$notice The tracking URI is not called until the end. To opt-out, kill this script and look for the propor command on the GitHub README.md."
95
112
elif [[ $disallowTracking==true ]]
96
113
then
97
-
echo"$info You have selected to optout of tracking. The tracking URI should not be called at the end."
114
+
echo"$info You have selected to opt-out of tracking."
98
115
else
99
116
echo"$fail Unknown disallowTracking option."
100
117
exit 1
101
118
fi
102
119
120
+
echo"$running Starting download test..."
103
121
downloadTest() {
104
122
name=$1
105
123
hostname=$2
@@ -112,7 +130,6 @@ downloadTest() {
112
130
scheme="http://"
113
131
fi
114
132
115
-
echo"$running Running $name download speed test from $scheme$hostname/$downloadFile..."
0 commit comments