-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathButtonForLinux.txt
More file actions
95 lines (77 loc) · 3.39 KB
/
Copy pathButtonForLinux.txt
File metadata and controls
95 lines (77 loc) · 3.39 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Starting pbss on Linux / Unix
================================
The pbss folder contains bBuilder, bCounter, and bViewer.
OPTION 1 — Shell script (works everywhere):
------------------------------------------------------------
Create start-bsuite.sh inside the pbss folder:
#!/bin/bash
SUITE_DIR="$(dirname "$0")"
echo "Starting bBuilder..."
cd "$SUITE_DIR/bBuilder"
./mvnw spring-boot:run >> "$SUITE_DIR/bBuilder.log" 2>&1 &
sleep 30 && xdg-open http://localhost:8080 &
echo "Starting bCounter..."
cd "$SUITE_DIR/bCounter"
./mvnw spring-boot:run >> "$SUITE_DIR/bCounter.log" 2>&1 &
sleep 30 && xdg-open http://localhost:8081 &
echo "Starting bViewer..."
cd "$SUITE_DIR/bViewer"
COUNTER_DB="$SUITE_DIR/bCounter/counter_results.db" \
./mvnw spring-boot:run >> "$SUITE_DIR/bViewer.log" 2>&1 &
sleep 30 && xdg-open http://localhost:8082 &
echo "All programs started. Logs in pbss/*.log"
------------------------------------------------------------
Make executable and run:
chmod +x start-bsuite.sh
./start-bsuite.sh
OPTION 2 — Desktop shortcut (.desktop file):
------------------------------------------------------------
[Desktop Entry]
Name=pbss
Comment=Start bBuilder, bCounter, and bViewer
Exec=bash -c 'SUITE=%h/pbss; cd $SUITE/bBuilder && ./mvnw spring-boot:run >> $SUITE/bBuilder.log 2>&1 & sleep 30 && xdg-open http://localhost:8080; cd $SUITE/bCounter && ./mvnw spring-boot:run >> $SUITE/bCounter.log 2>&1 & sleep 30 && xdg-open http://localhost:8081; cd $SUITE/bViewer && COUNTER_DB=$SUITE/bCounter/counter_results.db ./mvnw spring-boot:run >> $SUITE/bViewer.log 2>&1 & sleep 30 && xdg-open http://localhost:8082'
Terminal=false
Type=Application
------------------------------------------------------------
Replace %h with your home directory path.
Save as ~/Desktop/pbss.desktop, then: chmod +x ~/Desktop/pbss.desktop
OPTION 3 — Zenity dialog (GNOME; install with: sudo apt install zenity):
------------------------------------------------------------
#!/bin/bash
SUITE_DIR="$(dirname "$0")"
while true; do
CHOICE=$(zenity --list \
--title="pbss" \
--text="Choose an action:" \
--column="Action" \
"Start bBuilder" "Start bCounter" "Start bViewer" \
"Open bBuilder in Browser" "Open bCounter in Browser" "Open bViewer in Browser" \
"Stop All" "Quit" --height=320 2>/dev/null)
case "$CHOICE" in
"Start bBuilder")
cd "$SUITE_DIR/bBuilder"
./mvnw spring-boot:run >> "$SUITE_DIR/bBuilder.log" 2>&1 &
sleep 30 && xdg-open http://localhost:8080 & ;;
"Start bCounter")
cd "$SUITE_DIR/bCounter"
./mvnw spring-boot:run >> "$SUITE_DIR/bCounter.log" 2>&1 &
sleep 30 && xdg-open http://localhost:8081 & ;;
"Start bViewer")
cd "$SUITE_DIR/bViewer"
COUNTER_DB="$SUITE_DIR/bCounter/counter_results.db" \
./mvnw spring-boot:run >> "$SUITE_DIR/bViewer.log" 2>&1 &
sleep 30 && xdg-open http://localhost:8082 & ;;
"Open bBuilder in Browser") xdg-open http://localhost:8080 ;;
"Open bCounter in Browser") xdg-open http://localhost:8081 ;;
"Open bViewer in Browser") xdg-open http://localhost:8082 ;;
"Stop All")
pkill -f "spring-boot:run"
zenity --info --text="All programs stopped." --title="pbss" ;;
"Quit"|"") exit 0 ;;
esac
done
------------------------------------------------------------
STOPPING:
pkill -f "spring-boot:run"
LOG FILES (written to pbss folder):
bBuilder.log bCounter.log bViewer.log