Skip to content
Snippets Groups Projects
Commit b3b2551a authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

check existence of notify-send

parent 9f5f9748
No related branches found
No related tags found
2 merge requests!108Speedup couchdb backup,!107check existence of notify-send
...@@ -434,9 +434,10 @@ function j_notify(){ ...@@ -434,9 +434,10 @@ function j_notify(){
local _body="$( date +%H:%M:%S ) $2" local _body="$( date +%H:%M:%S ) $2"
local _rc="$3" local _rc="$3"
local _urgency="normal" if which notify-send >/dev/null 2>&1; then
if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then
local _urgency="normal"
if [ -n "$_rc" ]; then if [ -n "$_rc" ]; then
if [ "$_rc" = "0" ]; then if [ "$_rc" = "0" ]; then
_summary="OK: ${_summary}" _summary="OK: ${_summary}"
...@@ -445,8 +446,10 @@ function j_notify(){ ...@@ -445,8 +446,10 @@ function j_notify(){
_urgency="critical" _urgency="critical"
fi fi
fi fi
su "$SUDO_USER" -c "notify-send --urgency=${_urgency} '${_summary}' '${_body}'" su "$SUDO_USER" -c "notify-send --urgency=${_urgency} '${_summary}' '${_body}'"
fi fi
fi
} }
# ------------------------------------------------------------ # ------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment