-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest-curl.sh
More file actions
executable file
·52 lines (44 loc) · 1.06 KB
/
test-curl.sh
File metadata and controls
executable file
·52 lines (44 loc) · 1.06 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
#
# test currently installed curl version for https interop
#
# XXX - test http/2? https://github.com/curl/curl/issues/6825
#
if [ -z "${cwsw}" ] ; then
echo "is this crosware?" 1>&2
exit 1
fi
sn="${0}"
durl="https://www.google.com"
: ${copts:="-fkILs"}
if [[ ${@} =~ -h ]] ; then
cat >/dev/stderr<<EOF
${sn}: usage
${sn} # HTTPS HEAD test against default url: ${durl}
${sn} https://site.com/ # HTTPS HEAD test against site.com
env url=http://my.site ${sn} # HTTP HEAD test against my.site
# curl options in variable \${copts} - default: ${copts}
# note: \${url} environment variable takes precedence over cli argument
EOF
exit 1
fi
if [ ${#} -eq 0 ] ; then
: ${url:="${durl}"}
else
if [ -z "${url}" ] ; then
url="${1}"
fi
fi
rec=0
for i in $(realpath ${cwsw}/curl*/current/bin/curl-*{ssl,tls} ${cwsw}/tinycurl*/current/bin/tiny-curl 2>/dev/null | sort -u) ; do
echo "--"
echo "${i}"
echo "url: ${url}"
"${i}" --version
"${i}" ${copts} "${url}"
ec="${?}"
((rec+=ec))
echo "${ec}"
echo "--"
done
exit $((${rec}%256))