Skip to content

Commit

Permalink
Fix issues in backup.sh with notify-send
Browse files Browse the repository at this point in the history
  • Loading branch information
lindhe committed Jul 31, 2023
1 parent 3d6a647 commit 2641587
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backup/rsync_ssh/src/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ missing_dependencies=false
declare -r dependencies=(
logger
nmcli
notify-send
rsync
)
for dep in "${dependencies[@]}"; do
Expand Down Expand Up @@ -109,7 +108,7 @@ logprint() {
fi
logger "${LOG_PREFIX} ${1}"
if (command -v notify-send &> /dev/null); then
notify-send --urgency=low "${LOG_PREFIX} ${1}\n\nPlease check journalctl for more info."
su andreas -c "notify-send --urgency=low \"${LOG_PREFIX} ${1}\n\nPlease check journalctl for more info.\""
fi
}

Expand All @@ -118,7 +117,7 @@ logprint_err() {
stderr "${LOG_PREFIX} ${1}"
logger -p syslog.err "${LOG_PREFIX} ${1}"
if (command -v notify-send &> /dev/null); then
notify-send --urgency=critical "${LOG_PREFIX} ${1}\n\nPlease check journalctl for more info."
su andreas -c "notify-send --urgency=critical \"${LOG_PREFIX} ${1}\n\nPlease check journalctl for more info.\""
fi
}
#}}}
Expand Down

0 comments on commit 2641587

Please sign in to comment.