mirror of
https://github.com/AG7GN/nexus-utilities.git
synced 2025-05-21 08:50:13 -07:00
Added ability to specify destination email address(es) as argument
This commit is contained in:
parent
a9ad35a49a
commit
8d2f2ce2d4
@ -1 +1 @@
|
|||||||
VERSION="2.1.17"
|
VERSION="2.1.18"
|
6
vnc-server-activity.sh
Normal file → Executable file
6
vnc-server-activity.sh
Normal file → Executable file
@ -3,7 +3,7 @@
|
|||||||
# Extracts Connection events for VNC server activity occuring in the past 24 hours
|
# Extracts Connection events for VNC server activity occuring in the past 24 hours
|
||||||
# and emails results via patmail.sh and pat
|
# and emails results via patmail.sh and pat
|
||||||
|
|
||||||
VERSION="1.0.3"
|
VERSION="1.1.0"
|
||||||
|
|
||||||
# Pat and patmail.sh must be installed. If they are not, exit.
|
# Pat and patmail.sh must be installed. If they are not, exit.
|
||||||
command -v pat >/dev/null 2>&1 || exit 1
|
command -v pat >/dev/null 2>&1 || exit 1
|
||||||
@ -14,7 +14,7 @@ FILES="/var/log/user.log*"
|
|||||||
# Mail VNC Server login activity for last 24 hours.
|
# Mail VNC Server login activity for last 24 hours.
|
||||||
# MAILTO can contain multiple destination email addresses. Separate addresses with a
|
# MAILTO can contain multiple destination email addresses. Separate addresses with a
|
||||||
# comma.
|
# comma.
|
||||||
MAILTO="w7ecg.wecg@gmail.com"
|
MAILTO="${1:-w7ecg.wecg@gmail.com}"
|
||||||
FILTERED="$(mktemp)"
|
FILTERED="$(mktemp)"
|
||||||
OUTFILE="$(mktemp)"
|
OUTFILE="$(mktemp)"
|
||||||
grep -h Connections $FILES 2>/dev/null 1>$FILTERED
|
grep -h Connections $FILES 2>/dev/null 1>$FILTERED
|
||||||
@ -48,6 +48,6 @@ fi
|
|||||||
# cat $OUTFILE
|
# cat $OUTFILE
|
||||||
#} | /usr/sbin/ssmtp $MAILTO
|
#} | /usr/sbin/ssmtp $MAILTO
|
||||||
|
|
||||||
cat $OUTFILE | sort | uniq | /usr/local/bin/patmail.sh $MAILTO "$HOSTNAME VNC Server activity for 24 hours preceding `date`" telnet
|
cat $OUTFILE | sort | uniq | $(command -v patmail.sh) $MAILTO "$HOSTNAME VNC Server activity for 24 hours preceding `date`" telnet
|
||||||
rm $OUTFILE
|
rm $OUTFILE
|
||||||
rm $FILTERED
|
rm $FILTERED
|
||||||
|
Loading…
x
Reference in New Issue
Block a user