Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 06776f1

Browse files
authored
Merge pull request #3 from ooni/hellais-patch-1
Generate the CAIDA data timestamp based on the current month
2 parents bc826a4 + 0c39d69 commit 06776f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

generator_ripe_caida.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ set -exuo pipefail
88
# Use cpu-efficient tools across 2-4 cores
99

1010
tstamp=$(date +%Y%m%d%H%M%S)
11-
caida_tstamp=20201001
11+
# Obtain the last timestamp of caida data from the listing page. This should work until 2099 or until they change the format of their timestamp
12+
caida_tstamp=$(curl http://data.caida.org/datasets/as-organizations/ | grep "<a href=\"20" | tail -n 1 | cut -d '"' -f2 | cut -d "." -f1)
13+
# Safeguard to ensure we parsed the timestamp properly
14+
[[ $caida_tstamp =~ ^20[0-9]{2}[0-1][0-9][0-3][0-9] ]] || exit 1
1215

1316
echo "$(date) starting generator"
1417
# Fetch BGP dump

0 commit comments

Comments
 (0)