Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Teltonika TRB145 MQTT bridge CA file optional
diff -Naur a/package/network/services/mosquitto/files/etc/init.d/mosquitto b/package/network/services/mosquitto/files/etc/init.d/mosquitto
--- a/package/network/services/mosquitto/files/etc/init.d/mosquitto 2021-01-22 12:26:37.133159507 +0200
+++ b/package/network/services/mosquitto/files/etc/init.d/mosquitto 2021-01-22 12:28:00.509120517 +0200
@@ -124,7 +124,7 @@
# Use TLS/SSL for bridge connection
if [ "$use_remote_tls" == "1" ]; then
- echo "bridge_cafile $bridge_ca_file" >> $CONFIG
+ [ -n "$bridge_ca_file" ] && echo "bridge_cafile $bridge_ca_file" >> $CONFIG || echo "bridge_cafile /etc/cacert.pem" >> $CONFIG
[ -n "$bridge_cert_file" ] && echo "bridge_certfile $bridge_cert_file" >> $CONFIG
[ -n "$bridge_key_file" ] && echo "bridge_keyfile $bridge_key_file" >> $CONFIG
echo "bridge_tls_version $bridge_tls_version" >> $CONFIG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment