#!/usr/bin/env bash

#（上报 + 控制）
BROKER="your.mqtt.server.ip"
PORT=1883

START_IMEI=862538065276000
COUNT=1000
CLIENT="web_001"

echo "Start mixed pressure test"

while true; do
  OFFSET=$((RANDOM % COUNT))
  DEVICE=$((START_IMEI + OFFSET))
  mosquitto_pub -h "$BROKER" -p "$PORT" \
    -t "frontend/${CLIENT}/control/${DEVICE}" \
    -m '{"jm1g":1}'
  sleep 0.2
done
