-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
start.sh
executable file
·72 lines (68 loc) · 1.75 KB
/
start.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
#!/usr/bin/env bash
#set -Eeuo pipefail
echo "starting container at: $(date)"
if ! [ -f /.fs-setup-complete ]; then
echo "Setting up container filesystem"
/scripts/fs-setup.sh
else
echo "Looks like this container has already been started once."
echo "Just doing a little cleanup instead of the whole fs-setup."
# we assume it has run already so let's make sure there are no
# existing pid and sock files to cause issues.
find / -iname "*.sock" -exec rm -f {} \;
find /run -iname "*.pid" -exec rm -f {} \;
fi
echo "Choosing container start method from:"
echo "$@"
# We'll use this later to know how to check container health
echo "$1" > /usr/local/etc/running-as
sorry() {
echo " Sorry.. this version not ready for multi-container."
echo " Check https://github.com/immauss/openvas for latest news."
echo " Sleeping for 30 days instead of just restarting."
echo " You should use a different tag. "
sleep 30d
}
case $1 in
gsad)
echo "Starting Greenbone Security Assitannt !!"
exec /scripts/gsad.sh
;;
gvmd)
echo "Starting Greenbone Vulnerability Manager daemon !!"
exec /scripts/gvmd.sh
;;
openvas)
echo "Starting ospd-openvas !!"
exec /scripts/openvas.sh
;;
notus)
echo "Starting notus-scanner !!"
exec /scripts/notus-scanner.sh
;;
postgresql)
echo "Starting postgresql for gvmd !!"
exec /scripts/postgresql.sh
;;
redis)
echo "Starting redis !!"
exec /scripts/redis.sh
;;
mosquitto)
echo "Starting the mosquitto !!"
exec /scripts/mosquitto.sh
;;
remote)
echo "Start remote scanner !!"
exec /scripts/remote-scanner.sh
;;
debug)
echo "Starting bash shell!!"
/bin/bash -c "sleep 30d"
;;
*)
echo "Starting gvmd & openvas in a single container !!"
echo "single" > /usr/local/etc/running-as
exec /scripts/single.sh $@
;;
esac