-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpkic_run.sh
executable file
·81 lines (69 loc) · 1.8 KB
/
rpkic_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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
#############################################################
# Correr RPKI Client
#############################################################
docker_volume="rpkic_rpkiv5_cache"
docker_container="rpkic_rpkiv5"
# docker_image="rpki/rpki-client:9.0"
docker_image="rpki/rpki-client:8.2"
# docker_image="rpki/rpki-client:7.7"
# docker_image="rpki/rpki-client:7.0"
# docker_options="--dns 172.17.0.2 -p:3323:3323 -p 8323:8323"
docker_options="-d --dns 172.17.0.2"
rpkiv5_host="96.126.99.186"
#
cli_parameters="-s 480 -c -v -v -v"
# prune volume
function prune() {
echo "Pruning cache volume"
docker rm -f $docker_container
docker volume rm $docker_volume
}
# Define validate_current
function current() {
echo "Validating lacnic rpki against current system (no --add-host)"
echo "Using image: $docker_image"
docker rm -f $docker_container
docker run --rm \
-v $docker_volume:/var/cache/rpki-client \
-v $(pwd)/tals:/etc/tals \
$docker_options \
--name $docker_container \
$docker_image $cli_parameters
}
# Define rpkiv5
function rpkiv5() {
echo "Validating lacnic rpki against rpkiv5 system (full --add-host)"
echo "Using image: $docker_image"
docker rm -f $docker_container
docker run --rm \
-v $docker_volume:/root/cache \
-v $(pwd)/tals:/etc/tals \
--add-host rrdp.lacnic.net:$rpkiv5_host \
$docker_options \
--name $docker_container \
$docker_image $cli_parameters
}
function logsf() {
echo "Following logs"
docker logs -f --timestamps $docker_container
}
# Check command-line arguments
case "$1" in
prune)
prune
;;
current)
current
;;
rpkiv5)
rpkiv5
;;
logsf)
logsf
;;
*)
echo "Usage: $0 {prune|current|rpkiv5"
exit 1
esac
exit 0