[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to configure smartd and send notifications?

From: Felix Lechner
Subject: Re: How to configure smartd and send notifications?
Date: Thu, 23 May 2024 21:10:02 -0700

Hi Tristan,

On Thu, May 23 2024, Tristan Kohl via wrote:

> I did not even think about using Guile as the executable :D

Congratulations!  Maybe you will stop writing shell scripts altogether.

> Wrong type to apply: #<unspecified>

For me, that error often means an extra pair of parentheses, such as
trying to evaluate a constant, but here the issue could be that http-get
returns two values. [1]

Maybe this works without an error?

    (use-module (gnu) (guix modules))
    (use-package-modules tls)
    (define smartd-send-ntfy
      (program-file "smartd-send-ntfy"
        (with-extensions (list gnutls)
            (source-module-closure '((ice-9 receive)
                                      (web client)))
            #~((use-modules (ice-9 receive)
                            (web client))
               (receive (_ body)
                   (http-get "";)

Instead of the string body, you could return a success value via
something like

    (not (string-null? body))

You can look at the values in the comfort of the Guile REPL, or in Emacs

Kind regards


reply via email to

[Prev in Thread] Current Thread [Next in Thread]