From 4b0f4e4bdcbf92d77ea92012f1fe84b9539b9c6f Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Thu, 13 Aug 2009 13:19:31 +0000 Subject: Properly log promisc messages. --- cron-sh/promisc_check.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cron-sh/promisc_check.sh') diff --git a/cron-sh/promisc_check.sh b/cron-sh/promisc_check.sh index 99036a4..62d61e2 100755 --- a/cron-sh/promisc_check.sh +++ b/cron-sh/promisc_check.sh @@ -5,10 +5,14 @@ LogPromisc() { date=`date` - Syslog "Security warning : $1 is in promiscuous mode." - Syslog " A sniffer is probably running on your system." - Ttylog "\\033[1;31mSecurity warning : $1 is in promiscuous mode.\\033[0;39m" - Ttylog "\\033[1;31mA sniffer is probably running on your system.\\033[0;39m" + tempfile=`mktemp /tmp/promisc.XXXXXX` + echo "Security warning : $1 is in promiscuous mode." > $tempfile + echo " A sniffer is probably running on your system." >> $tempfile + Syslog $tempfile + echo "\\033[1;31mSecurity warning : $1 is in promiscuous mode.\\033[0;39m" > $tempfile + echo "\\033[1;31mA sniffer is probably running on your system.\\033[0;39m" >> $tempfile + Ttylog $tempfile + rm -f $tempfile # are we being run from security.sh script? if [ ! -z "$SECURITY" ]; then -- cgit v1.2.1