-
Notifications
You must be signed in to change notification settings - Fork 0
/
rnator_run.sh
executable file
·65 lines (55 loc) · 1.7 KB
/
rnator_run.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
61
62
63
64
#!/bin/bash
#############################################################
#
#############################################################
docker_volume="routinator_rpkiv5_cache"
docker_container="routinator_rpkiv5"
docker_image="nlnetlabs/routinator:latest"
#docker_image="nlnetlabs/routinator:v0.12.2"
docker_options="--dns 172.17.0.2 -p 3323:3323 -p 8323:8323"
cli_parameters="--disable-rsync -vv -r /home/routinator/.rpki-cache --no-rir-tals --extra-tals-dir=/tmp/tals server --refresh=120"
# prune volume
function prune() {
echo "Pruning cache volume"
docker volume rm $docker_volume
docker rm -f $docker_container
# Add your commands for action1 here
}
# Define validate_current
function current() {
echo "Validating lacnic rpki against current system (no --add-host)"
docker rm -f $docker_container
docker run --rm \
-v $(pwd)/tals:/tmp/tals \
-v $docker_volume:/home/routinator/.rpki-cache \
$docker_options \
--name $docker_container \
$docker_image $cli_parameters
}
# Define rpkiv5
function rpkiv5() {
echo "Validating lacnic rpki against current system (no --add-host)"
docker run --rm \
-v $(pwd)/tals:/tmp/tals \
-v $docker_volume:/home/routinator/.rpki-cache \
$docker_options \
--add-host rrdp.lacnic.net:139.144.255.162 \
--name $docker_container \
$docker_image --disable-rsync -vv -r /home/routinator/.rpki-cache --no-rir-tals --extra-tals-dir=/tmp/tals server
}
# Check command-line arguments
case "$1" in
prune)
prune
;;
current)
current
;;
rpkiv5)
rpkiv5
;;
*)
echo "Usage: $0 {prune|current|rpkiv5"
exit 1
esac
exit 0