-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.sh
More file actions
executable file
·35 lines (31 loc) · 1.05 KB
/
main.sh
File metadata and controls
executable file
·35 lines (31 loc) · 1.05 KB
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
#!/bin/bash
# Get the script's directory
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
# Start backend monitor
echo "Starting backend monitor..."
if [ -f "$SCRIPT_DIR/backend/monitor" ]; then
echo "Found 'monitor' executable in $SCRIPT_DIR/backend."
"$SCRIPT_DIR/backend/monitor" &
backend_pid=$!
echo "Backend monitor started with PID: $backend_pid"
else
echo "Error: 'monitor' file not found in $SCRIPT_DIR/backend."
exit 1
fi
# Start frontend SysGuard
echo "Starting frontend SysGuard..."
if [ -f "$SCRIPT_DIR/frontend/monitor" ]; then
echo "Found 'sysguard' executable in $SCRIPT_DIR/frontend."
"$SCRIPT_DIR/frontend/monitor" &
frontend_pid=$!
echo "Frontend SysGuard started with PID: $frontend_pid"
else
echo "Error: 'sysguard' file not found in $SCRIPT_DIR/frontend."
echo "Stopping backend monitor..."
kill $backend_pid
exit 1
fi
# Wait for both processes to complete
echo "Both backend and frontend are running. Press Ctrl+C to stop."
trap "echo 'Stopping processes...'; kill $backend_pid $frontend_pid" EXIT
wait