forked from MISP/misp-modules
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlaunch.sh
executable file
·49 lines (42 loc) · 1.03 KB
/
launch.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
#!/bin/bash
isscripted=`screen -ls | egrep '[0-9]+.misp_mod' | cut -d. -f1`
function killscript {
if [ $isscripted ]; then
screen -X -S misp_mod quit
fi
}
function launch {
export FLASKENV="development"
killscript
screen -dmS "misp_mod"
screen -S "misp_mod" -X screen -t "misp_modules_server" bash -c "misp-modules -l 127.0.0.1; read x"
sleep 2
python3 app.py -m
python3 app.py
}
function test {
export FLASKENV="testing"
pytest
}
function init_db {
python3 app.py -i
}
function reload_db {
python3 app.py -r
}
if [ "$1" ]; then
case $1 in
-l | --launch ) launch;
;;
-i | --init_db ) init_db;
;;
-r | --reload_db ) reload_db;
;;
-t | --test ) test;
;;
-ks | --killscript ) killscript;
esac
shift
else
launch
fi