Skip to content

Commit a2cfc05

Browse files
committed
Added option to set MQTT broker
1 parent 4cf3e9d commit a2cfc05

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ RUN wget --progress=dot:giga --no-check-certificate -O "$MQTT_SN_REPO".zip "$MQT
1010
RUN unzip "$MQTT_SN_REPO".zip
1111
RUN rm "$MQTT_SN_REPO".zip
1212

13-
RUN cd "$MQTT_SN_REPO"-develop/MQTTSNGateway && sed -i "s/^BrokerName=.*$/BrokerName=137.135.83.217/" gateway.conf
1413
RUN cd "$MQTT_SN_REPO"-develop/MQTTSNGateway && sed -i "s/^GatewayUDP6Hops=.*$/GatewayUDP6Hops=64/" gateway.conf
1514
RUN cd "$MQTT_SN_REPO"-develop/MQTTSNGateway && sed -i "s/^GatewayUDP6Port=.*$/GatewayUDP6Port=47193/" gateway.conf
1615
RUN cd "$MQTT_SN_REPO"-develop/MQTTSNGateway && sed -i "s/^GatewayUDP6Broadcast=.*$/GatewayUDP6Broadcast=ff33:40:fdde:ad00:beef:0:0:1/" gateway.conf

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ The command line options with default values are shown in the following table.
3232
| NAT64 Prefix | --nat64-prefix | 64:ff9b::/96 | |
3333
| Default prefix route | --disable-default-prefix-route | Enabled | |
3434
| Default prefix slaac | --disable-default-prefix-slaac | Enabled | |
35+
| MQTT Broker | --broker | mqtt.eclipse.org | |
3536

3637
1: These are changed only when the Network Name is changed. To force a change you must change the Network Name.

docker_entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ function parse_args()
8989
shift
9090
;;
9191

92+
--broker)
93+
BROKER_NAME=$2
94+
shift
95+
shift
96+
;;
97+
9298
*)
9399
shift
94100
;;
@@ -111,6 +117,7 @@ parse_args "$@"
111117
[ -n "$NETWORK_XPANID" ] || NETWORK_XPANID="DEAD00BEEF00CAFE"
112118
[ -n "$NCP_CHANNEL" ] || NCP_CHANNEL="11"
113119
[ -n "$NETWORK_PSKC" ] || NETWORK_PSKC="E00F739803E92CB42DAA7CCE1D2A394D"
120+
[ -n "$BROKER_NAME" ] || BROKER_NAME="mqtt.eclipse.org"
114121

115122
echo "NCP_PATH:" $NCP_PATH
116123
echo "TUN_INTERFACE_NAME:" $TUN_INTERFACE_NAME
@@ -123,6 +130,8 @@ NAT64_PREFIX=${NAT64_PREFIX/\//\\\/}
123130
sed -i "s/^prefix.*$/prefix $NAT64_PREFIX/" /etc/tayga.conf
124131
sed -i "s/dns64.*$/dns64 $NAT64_PREFIX {};/" /etc/bind/named.conf.options
125132

133+
sed -i "s/^BrokerName=.*$/BrokerName=$BROKER_NAME/" /app/borderrouter/gateway.conf
134+
126135
echo "Config:NCP:SocketPath \"$NCP_PATH\"" > /etc/wpantund.conf
127136
echo "Config:TUN:InterfaceName $TUN_INTERFACE_NAME " >> /etc/wpantund.conf
128137
echo "Daemon:SetDefaultRouteForAutoAddedPrefix $AUTO_PREFIX_ROUTE" >> /etc/wpantund.conf

0 commit comments

Comments
 (0)