-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_init.sh
executable file
·37 lines (29 loc) · 1.12 KB
/
docker_init.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
#!/usr/bin/env bash
#DATA_DIR=/var/lib/grnoc/netsage/
DATA_DIR=/data/cache/
LOGSTASH_DIR=/usr/share/logstash/pipeline/support
mkdir -p $DATA_DIR && echo "Cache directory ${DATA_DIR} created" || echo "cache dir ${DATA_DIR} already exists"
FILES="GeoLite2-ASN scireg GeoLite2-City"
CAIDA_FILES="CAIDA-org-lookup"
RUBY_DATA="FRGP-members-list ilight-members-list"
function downloadFiles() {
ext=$1
shift 1
## Download all files to temporary destination
for f in $@; do
wget https://epoc-rabbitmq.tacc.utexas.edu/NetSage/${f}.${ext} --no-use-server-timestamps -q -O ${DATA_DIR}/$f.tmp
#wget https://scienceregistry.grnoc.iu.edu/exported/${f}.${ext} --no-use-server-timestamps -q -O ${DATA_DIR}/$f.tmp
done
## Rename the temporary files to replace the production ones.
for f in $@; do
mv ${DATA_DIR}/$f.tmp ${DATA_DIR}/${f}.${ext}
done
}
echo "Download ScienceRegistry and maxmind"
downloadFiles mmdb $FILES
echo "Download Caida Files"
downloadFiles csv $CAIDA_FILES
#these are out of date, so skip for now
#echo "Download Ruby files"
#DATA_DIR=$LOGSTASH_DIR
#downloadFiles rb $RUBY_DATA