2
0
Fork 0

sh.zio.backup: fix notify not handling messages right

main
Ducky 2024-04-02 00:17:45 +01:00
parent a0c489b0c7
commit 991a21a5be
1 changed files with 12 additions and 7 deletions

View File

@ -166,13 +166,18 @@ function trigger_notify() {
if [[ ! -f "$notify_prog" ]]; then
say warning "'$notify_prog' does not exist. Not sending notification"
else
notify_command="$notify_prog"
[[ -n "$log_path" ]] && notify_command+=" --file \"$log_path\""
[[ -n "$message" ]] && notify_command+=" --message '\\`\\`\\`\\n'\"${message//$'\n'/'\\n'}\"'\\n\\`\\`\\`'"
notify_command+=" --level $level"
notify_command+=" --title \"$title\""
eval $notify_command
if [[ -n "$message" ]]; then
"$notify_prog" \
--file "$log_path" \
--level "$level" \
--title "$title"
else
"$notify_prog" \
--file "$log_path" \
--level "$level" \
--message '\\`\\`\\`\\n'"${message//$'\n'/'\\n'}"'\\n\\`\\`\\`' \
--title "$title"
fi
fi
}