-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.sh
executable file
·64 lines (57 loc) · 1.48 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
#!/bin/bash
DEFAULT_HOST="127.0.0.1"
DEFAULT_PORT="4001"
usage() {
echo "Usage: $0 --exercise_folder <folder> [--host <host>] [--port <port>] [--misp_url <misp_url>] [--misp_apikey <misp_apikey>] [--misp_skipssl_state <misp_skipssl_state>]"
exit 1
}
HOST="${SKILLAEGIS_HOST:-""}"
PORT="${SKILLAEGIS_PORT:-""}"
EXERCISE_FOLDER="${SKILLAEGIS_EXERCISE_FOLDER:-""}"
MISP_URL="${SKILLAEGIS_MISP_URL:-""}"
MISP_APIKEY="${SKILLAEGIS_MISP_APIKEY:-""}"
MISP_SKIPSSL="${SKILLAEGIS_MISP_SKIPSSL:-"default"}"
while [ "$#" -gt 0 ]; do
case "$1" in
--host)
HOST="$2"
shift 2
;;
--port)
PORT="$2"
shift 2
;;
--exercise_folder)
EXERCISE_FOLDER="$2"
shift 2
;;
--misp_url)
MISP_URL="$2"
shift 2
;;
--misp_apikey)
MISP_APIKEY="$2"
shift 2
;;
--misp_skipssl_state)
MISP_SKIPSSL="$2"
shift 2
;;
*)
usage
;;
esac
done
if [ -z "$EXERCISE_FOLDER" ]; then
echo "Error: --exercise_folder value is required."
usage
fi
HOST=${HOST:-$DEFAULT_HOST}
PORT=${PORT:-$DEFAULT_PORT}
source venv/bin/activate
python3 ./backend/main.py \
--host "$HOST" --port "$PORT" \
--exercise_folder "$EXERCISE_FOLDER" \
--misp_url "$MISP_URL" \
--misp_apikey "$MISP_APIKEY" \
--misp_skipssl_state "$MISP_SKIPSSL"