-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome_network_monitoring.sh
67 lines (49 loc) · 3.88 KB
/
home_network_monitoring.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
#!/bin/bash
# Setup global variables for the installation
python_source_activate=.venv/Scripts/activate
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ];
then
python_source_activate=.venv/bin/activate
fi
# Assuming we are launching this app from our work folder.
# We will launch this script as sudo of pythonping library use.
# 1) Setup the database
cd home-network-monitoring-database
python database_initialization.py
cd ..
# 2) Launch ETL
cd home-network-monitoring-etl
source $python_source_activate
python etl.py >/dev/null 2>etl.log &
pid_etl=$!
cd ..
# 3) Launch API
cd home-network-monitoring-api
source $python_source_activate
uvicorn api:app --reload >/dev/null 2>api.log &
pid_api=$!
cd ..
# 4) Launch frontend
cd home-network-monitoring-ui/ui
ng serve --open >/dev/null 2>ui.log &
pid_ui=$!
cd ../..
trap exit_process SIGINT
exit_process() {
kill -9 $pid_api $pid_etl $pid_ui &>/dev/null
exit
}
echo "
██╗ ██╗ ██████╗ ███╗ ███╗███████╗ ███╗ ██╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ███╗ ███╗ ██████╗ ███╗ ██╗██╗████████╗ ██████╗ ██████╗ ██╗███╗ ██╗ ██████╗
██║ ██║██╔═══██╗████╗ ████║██╔════╝ ████╗ ██║██╔════╝╚══██╔══╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝ ████╗ ████║██╔═══██╗████╗ ██║██║╚══██╔══╝██╔═══██╗██╔══██╗██║████╗ ██║██╔════╝
███████║██║ ██║██╔████╔██║█████╗ ██╔██╗ ██║█████╗ ██║ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝ ██╔████╔██║██║ ██║██╔██╗ ██║██║ ██║ ██║ ██║██████╔╝██║██╔██╗ ██║██║ ███╗
██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ██║╚██╗██║██╔══╝ ██║ ██║███╗██║██║ ██║██╔══██╗██╔═██╗ ██║╚██╔╝██║██║ ██║██║╚██╗██║██║ ██║ ██║ ██║██╔══██╗██║██║╚██╗██║██║ ██║
██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗ ██║ ╚████║███████╗ ██║ ╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗ ██║ ╚═╝ ██║╚██████╔╝██║ ╚████║██║ ██║ ╚██████╔╝██║ ██║██║██║ ╚████║╚██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═════╝
"
echo "Dashboard will be opened in a few seconds..."
echo "Press Ctrl + C to stop the application..."
while true
do
sleep 1
done