Now I want to use info from the freshclam log to see if it has been updated in a time frame and if so not update again and if not then continue with the update.
how can I pull the info from the freshclam log and make use of it like this?
Code: Select all
[#!/bin/bash clear exit=? wget -q --tries=10 --timeout=20 -O - http://google.com > /dev/null if [[ $? -eq 0 ]]; then # -eq 0 means connected if pulled log info to see if virus database has been updated in the last few hours if not then continuse with freshclam update echo echo -e "Internet connected updating virus database before scan\n" echo >> /home/Greg/ScanLog/Clam.log echo "Internet connected updating virus database before scan" >> /home/Greg/ScanLog/Clam.log sleep 4; clear /usr/local/bin/avscripts/avupdate/avupdate # starts freshclam to update virus database else log shows freshclam virus database as beiing updated in time frame DO NOT continue with update fi exit else echo echo -e "Internet disconnected running scan without updating virus database\n" echo >> /home/Greg/ScanLog/Clam.log echo "Internet disconnected running scan without updating virus database" >> /home/Greg/ScanLog/Clam.log fi exit
formatting went wonky , don't know why.