-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcensys-qualys.sh
executable file
·53 lines (44 loc) · 1.11 KB
/
censys-qualys.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
#!/bin/bash
# usage:
# first time run to create container: ./censys-qualys.sh build
# subsequent runs of existing container: ./censys-qualys.sh run
name="qualys"
network="host"
host_storage="$HOME/censys/$name"
container_storage="/opt/censys/$name/storage"
image="$name:latest"
if [ "$1" == "build" ]
then
echo
echo -n "By using this software you agree to the license contained in the LICENSE file: (y/N/read) "
read answer
echo
if [ "$answer" == "read" ]
then
cat ./LICENSE
echo
echo -n "By using this software you agree to the license contained in the LICENSE file: (y/N) "
read answer
echo
fi
if [ "$answer" == "Y" ] || [ "$answer" == "y" ]
then
docker build . -t $image
fi
exit
fi
if [ "$1" == "once" ]
then
docker run -it --env CENSYS_RUN_ONCE=1 --network $network --rm -v $host_storage:$container_storage $image
exit
fi
if [ "$1" == "run" ]
then
docker run --rm -d --network $network -v $host_storage:$container_storage $image
exit
fi
if [ "$1" == "cli" ]
then
docker run -it --env CENSYS_RUN_ONCE=1 --network $network --rm -v $host_storage:$container_storage $image node cli.js
exit
fi