Removed some old/unneeded shell scripts and formatted the rest
This commit is contained in:
parent
86ba9538de
commit
7e48c8f75a
15 changed files with 51 additions and 369 deletions
|
@ -5,22 +5,22 @@ alert="Signature detected: $CLAM_VIRUSEVENT_VIRUSNAME in $CLAM_VIRUSEVENT_FILENA
|
|||
|
||||
# Send the alert to systemd logger if exist, othewise to /var/log
|
||||
if [[ -z $(command -v systemd-cat) ]]; then
|
||||
echo "$(date) - $alert" >> /var/log/clamav/infected.log
|
||||
echo "$(date) - $alert" >>/var/log/clamav/infected.log
|
||||
else
|
||||
# as "emerg", this could cause your DE to show a visual alert. Happen in Plasma. but the next visual alert is much nicer
|
||||
echo "$alert" | /usr/bin/systemd-cat -t clamav -p emerg
|
||||
# as "emerg", this could cause your DE to show a visual alert. Happen in Plasma. but the next visual alert is much nicer
|
||||
echo "$alert" | /usr/bin/systemd-cat -t clamav -p emerg
|
||||
fi
|
||||
|
||||
#send an alrt to all graphical user
|
||||
XUSERS=($(who|awk '{print $1}'|sort -u))
|
||||
XUSERS=($(who | awk '{print $1}' | sort -u))
|
||||
|
||||
for XUSER in $XUSERS; do
|
||||
NAME=(${XUSER/(/ })
|
||||
DISPLAY=${NAME[1]/)/}
|
||||
DBUS_ADDRESS=unix:path=/run/user/$(id -u ${NAME[0]})/bus
|
||||
echo "run $NAME - $DISPLAY - $DBUS_ADDRESS -" >> /tmp/testlog
|
||||
/usr/bin/sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \
|
||||
DBUS_SESSION_BUS_ADDRESS=${DBUS_ADDRESS} \
|
||||
PATH=${PATH} \
|
||||
/usr/bin/notify-send -i dialog-warning "clamAV" "$alert"
|
||||
NAME=(${XUSER/(/ })
|
||||
DISPLAY=${NAME[1]/)/}
|
||||
DBUS_ADDRESS=unix:path=/run/user/$(id -u ${NAME[0]})/bus
|
||||
echo "run $NAME - $DISPLAY - $DBUS_ADDRESS -" >>/tmp/testlog
|
||||
/usr/bin/sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \
|
||||
DBUS_SESSION_BUS_ADDRESS=${DBUS_ADDRESS} \
|
||||
PATH=${PATH} \
|
||||
/usr/bin/notify-send -i dialog-warning "clamAV" "$alert"
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue