-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathstart_softwares.sh
More file actions
executable file
·70 lines (55 loc) · 1.8 KB
/
Copy pathstart_softwares.sh
File metadata and controls
executable file
·70 lines (55 loc) · 1.8 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
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
68
69
70
#!/bin/zsh
# Signal handler function
cleanup() {
echo -e "\nReceived interrupt signal, shutting down all child processes..."
# Send SIGTERM to all child processes
for PID in "${PIDS[@]}"; do
if kill -0 $PID 2>/dev/null; then
echo "Shutting down process $PID"
kill $PID
fi
done
# Wait for all processes to finish
wait
echo "All processes have been terminated"
exit 0
}
# Set up signal traps
trap cleanup INT TERM
# Array to store process IDs
PIDS=()
echo "Starting Light application suite..."
# Start each application
fastmcp run software/LightSystem/app.py --transport http --host 0.0.0.0 --port 9000 &
PIDS+=($!)
echo "LightSystem started (PID: $!, Port: 9000)"
sleep 1
fastmcp run software/LightTalk/app.py --transport http --host 0.0.0.0 --port 9001 &
PIDS+=($!)
echo "LightTalk started (PID: $!, Port: 9001)"
sleep 1
fastmcp run software/LightShop/app.py --transport http --host 0.0.0.0 --port 9002 &
PIDS+=($!)
echo "LightShop started (PID: $!, Port: 9002)"
sleep 1
fastmcp run software/LightWeather/app.py --transport http --host 0.0.0.0 --port 9003 &
PIDS+=($!)
echo "LightWeather started (PID: $!, Port: 9003)"
sleep 1
fastmcp run software/LightFlight/app.py --transport http --host 0.0.0.0 --port 9004 &
PIDS+=($!)
echo "LightFlight started (PID: $!, Port: 9004)"
sleep 1
fastmcp run software/LightStock/app.py --transport http --host 0.0.0.0 --port 9005 &
PIDS+=($!)
echo "LightStock started (PID: $!, Port: 9005)"
sleep 1
fastmcp run software/LightNews/app.py --transport http --host 0.0.0.0 --port 9006 &
PIDS+=($!)
echo "LightNews started (PID: $!, Port 9006)"
sleep 1
echo "All applications started successfully. Press Ctrl+C to shut down all applications."
# Wait for all processes
for PID in "${PIDS[@]}"; do
wait $PID
done