added checks

This commit is contained in:
olli 2023-01-17 09:04:36 +01:00
parent 57f2744916
commit 07588a498b

View File

@ -2,6 +2,8 @@
function g_signal-notify {
[ -z "$1" ] && return 0
[ -s /usr/local/bin/notify.sh ] || g_echo_error "$0: /usr/local/bin/notify.sh empty or not existing"
[ -x /usr/local/bin/notify.sh ] || g_echo_error "$0: /usr/local/bin/notify.sh not executable"
[ -n "${SIGNAL_GROUP}" ] && g_signal_group="-g \"${SIGNAL_GROUP}\""
cat <<< "$(g_date_print) $@" | tail -n 100 | /usr/local/bin/notify.sh $g_signal_group
cat <<< "$(g_date_print) $@" | tail -n 100 | /usr/local/bin/notify.sh $g_signal_group
}