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