File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Change to the directory where your Flask app is located
4+ # cd /home/alphahub/development/SystemDashboard || { echo "Directory not found"; exit 1; }
5+
6+ # Create virtual environment if it doesn't exist; otherwise, activate it
7+ eval " $( conda shell.bash hook) "
8+
9+ # Check if the conda environment exists
10+ if ! conda env list | grep -q " systemdashboard" ; then
11+ echo " Creating conda environment 'systemdashboard'"
12+ conda create -n systemdashboard python=3.10 -y
13+ echo " Activating conda environment 'systemdashboard'"
14+ conda activate systemdashboard
15+ echo " Installing required packages"
16+ pip install -r requirements.txt
17+ else
18+ echo " Activating existing conda environment 'systemdashboard'"
19+ conda activate systemdashboard
20+ fi
21+
22+ # Continue with the rest of your script
23+ echo " Conda environment 'systemdashboard' is active."
24+
25+ # Export Flask environment variables
26+ export FLASK_APP=app.py
27+ export FLASK_ENV=development # or production
28+
29+ # Check if Flask app is running
30+ if ! pgrep -f " flask run --host=0.0.0.0 --port=5050" > /dev/null; then
31+ echo " Flask app is not running. Starting..."
32+ flask run --host=0.0.0.0 --port=5050 &
33+ else
34+ echo " Flask app is already running."
35+ fi
You can’t perform that action at this time.
0 commit comments