##VARIABLE SETUP BSE=/admin/check LOGS=$BSE/logs NMAP=/usr/local/bin/nmap DATE=`date +%a-%b-%Y` ##REMOVE OLD LOG FILE IF NEEDED rm -rf $LOGS/results.$DATE.txt ##CHECK TO SEE IF THIS IS THE FIRST TIME WE ARE RUNNING if [ -f $LOGS/log.one ] then echo fine mv $LOGS/log.one $LOGS/log.two else touch $LOGS/log.one fi ##THE ACTUAL CHECKING - CHNAGE IP ADDRESSES AS NEEDED for x in 192.168.3.15 192.168.3.45 192.168.3.56 do $NMAP -sT $x -n -p 1-65535 -sV -sC --reason --open -oX $LOGS/log.one >> $LOGS/results.$DATE.txt done ##CHECK TO FIND ALL LIVE HOSTS echo "Live Hosts?" > $LOGS/mail.log echo "" >> $LOGS/mail.log $NMAP -sP -n 192.168.3.1-254 >> $LOGS/mail.log echo "----------------------------" >> $LOGS/mail.log ##CHECK TO FIND ANY CHANGES echo "Any Changes?" >> $LOGS/mail.log echo "" >> $LOGS/mail.log /usr/bin/ndiff $LOGS/log.two $LOGS/log.one >> $LOGS/mail.log |