-
Notifications
You must be signed in to change notification settings - Fork 0
/
dear-ctserver.sh
executable file
·60 lines (54 loc) · 1.38 KB
/
dear-ctserver.sh
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
53
54
55
56
57
58
59
60
#!/bin/bash
ctservera="40.71.200.117"
ctserverb="13.92.181.187"
athos="athos"
gctserver="https://ct.googleapis.com/logs"
argon="argon2020"
cfctserver="https://ct.cloudflare.com/logs"
nimbus="nimbus2020"
function newline(){ echo ""; }
function get(){
# $1 => IP, $2 = prefix, $3 = operation, $4=verbose
url="$1/$2/ct/v1/$3"
echo "--> GET $url"
if [[ "$4" == "-v" ]]; then
curl -v $url && newline
else
curl $url && newline
fi
}
function trillian() {
url="$1:8091/metrics"
echo "--> GET $url"
curl -v $url && newline
}
while test $# -gt 0
do
case "$1" in
a) get $ctservera":6965" $athos "get-sth"
;;
b) get $ctserverb":6965" $athos "get-sth"
;;
c) get $cfctserver $nimbus "get-sth"
;;
g) get $gctserver $argon "get-sth"
;;
av) get $ctservera":6965" $athos "get-sth" "-v"
;;
bv) get $ctserverb":6965" $porthos "get-sth" "-v"
;;
cv) get $cfctserver $nimbus "get-sth" "-v"
;;
gv) get $gctserver $argon "get-sth" "-v"
;;
bt) trillian $ctserverb
;;
at) trillian $ctservera
;;
-h) echo "/dear-ctserver.sh [a|av|at||b|bv|bt||-h]"
;;
*) echo "ignoring argument $1; try ./dear-ctserver.sh -h"
;;
esac
shift
done