#!/bin/bash
formal_broker=116.62.127.242
formal_port=1883
wt_json=/home/linaro/wtdiagnose/file/usbconfig.json
frpc_json=/etc/frp/config.json

jq  --arg broker "$formal_broker" --arg port $formal_port '[.[] | .mqtt.broker = $broker | .mqtt.port = $port]' ${wt_json} > temp.json && mv temp.json ${wt_json}
jq  --arg broker "$formal_broker" --arg port $formal_port '.mqtt.broker = $broker | .mqtt.port = $port' ${frpc_json} > temp.json && mv temp.json ${frpc_json}