X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=bin%2Fkhatus_actuate_alert_to_notify_send;h=e3839172fbb072aa7eeab32c417834d84a03d944;hb=75b23ff8a814c76a4fa0fa12a40e6a929beec695;hp=b1c695a0dd4a39e4705b09b2b34215c26a88e570;hpb=43e499034fbf9fddc79b8ee9168634cb4edc98bd;p=khatus.git diff --git a/bin/khatus_actuate_alert_to_notify_send b/bin/khatus_actuate_alert_to_notify_send index b1c695a..e383917 100755 --- a/bin/khatus_actuate_alert_to_notify_send +++ b/bin/khatus_actuate_alert_to_notify_send @@ -6,14 +6,23 @@ BEGIN { # khatus_actuate_alert_to_notify_send -v display="$CORRECT_DISPLAY" # display = ":0" + FS = msg_fs ? msg_fs : "|" + OFS = msg_fs ? msg_fs : "|" + Kfs = key_fs ? key_fs : ":" } -/^ALERT / { +$1 == "OK" && \ +$3 == "alert" { src = $2 - priority = $3 - subject = $4 - sub("^" $1 " +" $2 " +" $3 " +" $4 " +", "") - body = $0 + priority = $4 + subject = $5 + + # Not just using $6 for body - because body might contain a character + # identical to FS + len_line = length($0) + len_head = length($1 FS $2 FS $3 FS $4 FS $5 FS) + len_body = len_line - len_head + body = substr($0, len_head + 1, len_body) sep = body ? "\n" : "" body = body sep "--" src