Skip to content

Commit ba22d5f

Browse files
committed
prefix WSL process outputs
1 parent a1a2344 commit ba22d5f

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

zwave_stack/run.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,33 @@
44

55
echo "Starting Z-Wave Stack..."
66

7+
# Helper function to prefix output with process name
8+
run_with_prefix() {
9+
local prefix="$1"
10+
shift
11+
"$@" 2>&1 | while IFS= read -r line; do echo "[$prefix] $line"; done
12+
}
13+
714
# Start 3 controllers
815
echo "Starting Controller 1 (Z-Wave JS) on port 5000..."
9-
./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 5000 --storage ./zwave_stack/storage/controller1 &
16+
run_with_prefix "Controller1" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 5000 --storage ./zwave_stack/storage/controller1 &
1017

1118
echo "Starting Controller 2 (CTT) on port 6001..."
12-
./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6001 --storage ./zwave_stack/storage/controller2 &
19+
run_with_prefix "Controller2" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6001 --storage ./zwave_stack/storage/controller2 &
1320

1421
echo "Starting Controller 3 (CTT) on port 6002..."
15-
./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6002 --storage ./zwave_stack/storage/controller3 &
22+
run_with_prefix "Controller3" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6002 --storage ./zwave_stack/storage/controller3 &
1623

1724
# Start 2 end devices
1825
echo "Starting End Device 1 on port 6003..."
19-
./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6003 --storage ./zwave_stack/storage/enddevice1 &
26+
run_with_prefix "EndDevice1" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6003 --storage ./zwave_stack/storage/enddevice1 &
2027

2128
echo "Starting End Device 2 on port 6004..."
22-
./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6004 --storage ./zwave_stack/storage/enddevice2 &
29+
run_with_prefix "EndDevice2" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6004 --storage ./zwave_stack/storage/enddevice2 &
2330

2431
# Start the Zniffer simulator
2532
echo "Starting Zniffer on port 4905..."
26-
python3 ./zwave_stack/bin/zniffer.py 1234 &
33+
run_with_prefix "Zniffer" python3 ./zwave_stack/bin/zniffer.py 1234 &
2734

2835
echo "All Z-Wave binaries started!"
2936
echo "Controller 1: localhost:5000 (Z-Wave JS FirstController)"

0 commit comments

Comments
 (0)