mirror of
https://github.com/openwrt/packages.git
synced 2026-10-12 05:57:04 +04:00
nut: fix custom notification messages
Messages with spaces must be enclosed in double-quotes. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
This commit is contained in:
1 parent
cf415f3e64
commit
5bdf894102
1 file changed
+2
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user