From: Daniel F. Dickinson Date: Thu, 27 Aug 2026 10:15:02 +0000 (-0400) Subject: nut: fix custom notification messages X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5bdf89410255c73bfedfaf1ccaf83f6644a7c818;p=openwrt-packages.git nut: fix custom notification messages Messages with spaces must be enclosed in double-quotes. Signed-off-by: Daniel F. Dickinson --- diff --git a/net/nut/files/nut-monitor-config.sh.functions b/net/nut/files/nut-monitor-config.sh.functions index 1b80e36f4..c93427184 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