From 5fc207e38a8f0f8d36601ee0a64deb7528fa3e05 Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 18 May 2023 11:09:07 -0700 Subject: [PATCH] Don't always try using password-file --- src/tattler/cli.clj | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/tattler/cli.clj b/src/tattler/cli.clj index 95f0168..72f45de 100644 --- a/src/tattler/cli.clj +++ b/src/tattler/cli.clj @@ -47,12 +47,14 @@ (when (seq errors) (msg-quit 1 (usage summary errors))) (let [{:keys [mqtt-host mqtt-port mqtt-user mqtt-password-file app-name notification-topic]} options catch-shutdown (async/chan) - mqtt-client (mqtt/connect-json! :host mqtt-host - :port mqtt-port - :username mqtt-user - :password (-> mqtt-password-file - (slurp) - (str/trim))) + mqtt-client (if mqtt-user + (mqtt/connect-json! :host mqtt-host + :port mqtt-port + :username mqtt-user + :password (-> mqtt-password-file + (slurp) + (str/trim))) + (mqtt/connect-json! :host mqtt-host :port mqtt-port)) logger (log/print-logger)] (tattler/listen! :app app-name :mqtt-client mqtt-client