Skip to content

Commit 70da649

Browse files
chore: Update SystemGuard app setup and dependencies in crontab
```
1 parent 5bb308f commit 70da649

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ System Guard is a Flask app designed to monitor server stats such as CPU, Memory
77
```bash
88
bash setup.sh
99
```
10-
It will install the SystemGuard app and its dependencies. The app will be available at `http://localhost:5050`.
10+
11+
It will install the SystemGuard app and its dependencies in the crontab and it will be started automatically every time the server is restarted. The app will be available at `http://localhost:5050`.
1112

1213
## Dependencies(must be installed)
1314

@@ -21,6 +22,9 @@ It will install the SystemGuard app and its dependencies. The app will be availa
2122
- Kill the process that is consuming the most CPU.
2223
- Real-time monitoring of server stats.
2324
- Responsive design that works on mobile, tablet, and desktop.
25+
- Update itself to the latest version.
26+
- Easy download and installation using a bash script.
27+
2428

2529
## Product Screenshots
2630

src/scripts/dashboard.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ log_message() {
77

88
# Determine the directory where this script is located
99
SCRIPT_DIR="$(dirname "$(realpath "$0" 2>/dev/null || readlink -f "$0")")"
10-
10+
# root directory of the project is two levels up
11+
PROJECT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
1112
# Define variables for paths relative to the script's directory
12-
FLASK_APP_PATH="${FLASK_APP_PATH:-$SCRIPT_DIR/app.py}"
13-
REQUIREMENTS_FILE="${REQUIREMENTS_FILE:-$SCRIPT_DIR/requirements.txt}"
13+
FLASK_APP_PATH="${FLASK_APP_PATH:-$PROJECT_DIR/app.py}"
14+
REQUIREMENTS_FILE="${REQUIREMENTS_FILE:-$PROJECT_DIR/requirements.txt}"
1415
FLASK_PORT="${FLASK_PORT:-5050}"
1516
LOG_FILE="/home/$(whoami)/logs/systemdashboard_flask.log"
1617
USERNAME="$(whoami)"
@@ -48,7 +49,7 @@ fi
4849
source "$CONDA_SETUP_SCRIPT"
4950

5051
# Define Conda environment name
51-
CONDA_ENV_NAME="dashboard"
52+
CONDA_ENV_NAME="dashboar"
5253

5354
echo "Conda environment name: $CONDA_ENV_NAME"
5455
echo $CONDA_EXECUTABLE
@@ -75,7 +76,7 @@ export FLASK_ENV=development # or production
7576
if ! pgrep -f "flask run --host=0.0.0.0 --port=$FLASK_PORT" > /dev/null; then
7677
# git pull in FLASK_APP_PATH directory
7778
current_dir=$(pwd)
78-
cd "$SCRIPT_DIR"
79+
cd "$PROJECT_DIR"
7980
if ! git pull; then
8081
log_message "Failed to pull updates from Git repository."
8182
cd "$current_dir"

0 commit comments

Comments
 (0)