From 688311671c249f91014d0ab92d5d0b0e5809fd81 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Tue, 24 Mar 2009 13:33:37 +0000 Subject: Added support for desktop notifications. --- cron-sh/diff_check.sh | 3 +++ cron-sh/security.sh | 10 ++++++++++ cron-sh/security_check.sh | 1 + 3 files changed, 14 insertions(+) (limited to 'cron-sh') diff --git a/cron-sh/diff_check.sh b/cron-sh/diff_check.sh index d3a142c..772edb3 100755 --- a/cron-sh/diff_check.sh +++ b/cron-sh/diff_check.sh @@ -208,9 +208,12 @@ if [[ -s ${TMP} ]]; then echo -e "\n\n*** Diff Check, ${date} ***\n" >> ${SECURITY_LOG} cat ${TMP} >> ${SECURITY_LOG} + + Notifylog "MSEC has performed Diff Check on ${hostname} on ${date}\nChanges in system security were detected and are available in ${SECURITY_LOG}." fi Maillog "[msec] *** Diff Check on ${hostname}, ${date} ***" "${TMP}" +Notifylog "MSEC has performed Diff Check on ${hostname} on ${date}\nNo changes were detected in system security." if [[ -f ${TMP} ]]; then rm -f ${TMP} diff --git a/cron-sh/security.sh b/cron-sh/security.sh index 9d48da5..e9a7eac 100755 --- a/cron-sh/security.sh +++ b/cron-sh/security.sh @@ -240,6 +240,16 @@ EOF fi } +Notifylog() { + if [ ${NOTIFY_WARN} == yes ]; then + message=${1} + DBUS_SEND=`which DBUS_SEND 2>/dev/null` + if [ -x "$DBUS_SEND" -a -s ${message} ]; then + dbus-send --system --type=signal /com/mandriva/user com.mandriva.user.security_notification string:"$message" + fi + fi +} + ################## . /usr/share/msec/diff_check.sh diff --git a/cron-sh/security_check.sh b/cron-sh/security_check.sh index 2b6fea6..bbff82a 100755 --- a/cron-sh/security_check.sh +++ b/cron-sh/security_check.sh @@ -317,6 +317,7 @@ if [[ -s ${SECURITY} ]]; then cat ${INFOS} >> ${SECURITY_LOG} Maillog "[msec] *** Security Check on ${hostname}, ${date} ***" "${SECURITY} ${INFOS}" + Notifylog "MSEC has performed Security Check on ${hostname} on ${date}" fi if [[ -f ${SECURITY} ]]; then -- cgit v1.2.1