From 991a21a5beb6191c035adf66748b046cd65e6d19 Mon Sep 17 00:00:00 2001 From: Ducky Date: Tue, 2 Apr 2024 00:17:45 +0100 Subject: [PATCH] sh.zio.backup: fix notify not handling messages right --- usr/local/bin/sh.zio.backup | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/usr/local/bin/sh.zio.backup b/usr/local/bin/sh.zio.backup index 38cd667..829ce40 100755 --- a/usr/local/bin/sh.zio.backup +++ b/usr/local/bin/sh.zio.backup @@ -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 }