From 5bdf89410255c73bfedfaf1ccaf83f6644a7c818 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Thu, 27 Aug 2026 06:15:02 -0400 Subject: [PATCH] nut: fix custom notification messages Messages with spaces must be enclosed in double-quotes. Signed-off-by: Daniel F. Dickinson --- net/nut/files/nut-monitor-config.sh.functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/nut/files/nut-monitor-config.sh.functions b/net/nut/files/nut-monitor-config.sh.functions index 1b80e36f41..c934271847 100644 --- a/net/nut/files/nut-monitor-config.sh.functions +++ b/net/nut/files/nut-monitor-config.sh.functions @@ -61,7 +61,8 @@ nut_get_notifications() { if [ "${event_types#*" $event "}" != "${event_types}" ]; then config_get val "$event" message if [ -n "$val" ]; then - if ! printf 'NOTIFYMSG %s %s\n' "$event" "$val" >>"$config_file"; then + val="$(printf '%s' "$val" | tr -d '"')" + if ! printf 'NOTIFYMSG %s "%s"\n' "$event" "$val" >>"$config_file"; then log_error "upsmon section '$event' failed to write 'NOTIFYMSG' for '$event'" nut-monitor-config.sh nut-monitor-config return 1 fi