Skip to content

Instantly share code, notes, and snippets.

@mohavirta
Last active January 22, 2021 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohavirta/672369a5e90f874f8f0f20d54930a686 to your computer and use it in GitHub Desktop.
Save mohavirta/672369a5e90f874f8f0f20d54930a686 to your computer and use it in GitHub Desktop.
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