From 414f1997664b9930efbab66d7723d3b757b8a032 Mon Sep 17 00:00:00 2001 From: Ducky Date: Mon, 1 Apr 2024 21:49:52 +0100 Subject: [PATCH] sh.zio.backup: modify notification title --- usr/local/bin/sh.zio.backup | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/usr/local/bin/sh.zio.backup b/usr/local/bin/sh.zio.backup index a20f3e4..9f9cd8d 100755 --- a/usr/local/bin/sh.zio.backup +++ b/usr/local/bin/sh.zio.backup @@ -181,9 +181,9 @@ function invoke_script() { script_output=$("$backup_scripts_dir/$backup_script_filename" 2>&1 | tee /dev/fd/3) if [[ "$?" == 0 ]]; then - trigger_notify "success" "Backup Successful: $backup_script_name" "$script_output" + trigger_notify "success" "Backup script succeeded: $backup_script_name" "$script_output" else - trigger_notify "error" "Backup Failed: $backup_script_name" "$script_output" + trigger_notify "error" "Backup script failed: $backup_script_name" "$script_output" fi set +o pipefail @@ -194,15 +194,12 @@ function trigger_notify() { level="$1" title="$2" output="$(echo "$3" | sed -r "s/\x1B\[[0-9;]*[JKmsu]//g")" - #output="yo" notify_prog="/usr/local/bin/sh.zio.notify" - echo "THE OUTPUT: $output" - if [[ ! -f "$notify_prog" ]]; then say warning "'$notify_prog' not found. Not sending notification" else - /usr/local/bin/sh.zio.notify \ + "$notify_prog" \ --level "$level" \ --message '```\\n'"${output//$'\n'/'\\n'}"'\\n```' \ --title "$title"