| OLD | NEW |
| (Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 set -e |
| 4 |
| 5 if [ $# -ne 1 ] ; then |
| 6 echo "This tool will download the full CertificateTransparency database and wr
ite it to a file (or synchronize an existing one)" |
| 7 echo "" |
| 8 echo "Usage: <path-to-output-ct-db>" |
| 9 exit 1 |
| 10 fi |
| 11 |
| 12 # Make sure GO is installed |
| 13 go version >/dev/null 2>&1 || { echo >&2 "ERROR: Need to have GO installed"; exi
t 1; } |
| 14 |
| 15 OUT_PATH="$(readlink -f "$1")" |
| 16 |
| 17 MY_DIR=$(mktemp -d) |
| 18 |
| 19 echo "Created temporary directory: $MY_DIR" |
| 20 |
| 21 cd "$MY_DIR" |
| 22 export GOPATH="$MY_DIR" |
| 23 |
| 24 echo "Downloading agl's certificatetransparency code into $MY_DIR" |
| 25 go get github.com/agl/certificatetransparency |
| 26 |
| 27 echo "Executing src/github.com/agl/certificatetransparency/tools/ct-sync.go" |
| 28 go run src/github.com/agl/certificatetransparency/tools/ct-sync.go "$OUT_PATH" |
| 29 |
| 30 # Cleanup this temporary directory. |
| 31 echo "Cleaning up and deleting $MY_DIR" |
| 32 rm -rf "$MY_DIR" |
| OLD | NEW |