feat: replace iot adapter with mqtt command pipeline
This commit is contained in:
11
scripts/run_iot.sh
Normal file
11
scripts/run_iot.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
PIDS=()
|
||||
cleanup(){ trap - EXIT INT TERM; for pid in "${PIDS[@]}"; do kill "${pid}" 2>/dev/null || true; done; for pid in "${PIDS[@]}"; do wait "${pid}" 2>/dev/null || true; done; }
|
||||
trap cleanup EXIT INT TERM
|
||||
(cd "${PROJECT_ROOT}/backend/iot-server" && go run ./cmd/main/main.go -config etc/platform_iot_server_dev.yaml) & PIDS+=("$!")
|
||||
(cd "${PROJECT_ROOT}/backend/iot-client" && go run ./cmd/main/main.go -config etc/platform_iot_client_dev.yaml) & PIDS+=("$!")
|
||||
echo "IoT Server :12428 与 IoT Client :12429 已启动。"
|
||||
wait -n "${PIDS[@]}"
|
||||
Reference in New Issue
Block a user