{"id":98,"date":"2008-09-14T13:27:25","date_gmt":"2008-09-14T13:27:25","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2008\/09\/14\/f-prot-scripts\/"},"modified":"2021-07-31T17:55:58","modified_gmt":"2021-07-31T17:55:58","slug":"f-prot-scripts","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/f-prot-scripts.html","title":{"rendered":"BASH – F-Prot Scripts"},"content":{"rendered":"
Here are 2 scripts created for the AV software F-Prot,<\/p>\n
Runs a scan on your system, you will need to enter you own path under the variable $path<\/p>\n
#!\/bin\/bash\r\n\r\n#Variables\r\npath=\/\r\n\r\n#binaries\r\nfprot=\/usr\/local\/f-prot\/f-prot\r\n\r\nif [ ! -x \"${fprot}\" ]; then\r\n echo \"Error: ${fprot} not found or not executable!\" | \/usr\/bin\/logger -t fprot_scan -p daemon.err\r\n exit 1\r\nfi\r\n\r\n${f-prot} ${path} -disinf -silent -report=\/var\/log\/fprot.log -dumb -archive -server -collect -ai\r\nRC=$?\r\n\r\nif [ ${RC} != 0 ]; then\r\n echo \"Error: ${fprot} returned rc=${RC}\" | \/usr\/bin\/logger -t fprot_scan -p daemon.err\r\nelse\r\n echo \"Completed successfully\" | \/usr\/bin\/logger -t fprot_scan -p daemon.err\r\nfi\r\n\r\nexit ${RC}\r\n<\/pre>\nFProt_mail<\/h2>\n
Emails you if a virus has been found on your system, you will need to add your own email address to $email<\/p>\n
#!\/bin\/bash\r\n\r\n#variables\r\nemail=\"myemail@somewhere.com\"\r\n\r\n#binaries\r\nmailx=\/usr\/bin\/mailx\r\n\r\nif [ ! -x \"${mailx}\" ]; then\r\n echo \"Error: ${mailx} not found or not executable!\" | \/usr\/bin\/logger -t fprot_mail -p daemon.err\r\n exit 1\r\nfi\r\n\r\nif egrep \"viruse|boot|suspicious\" \/var\/log\/fprot.log | grep -q No ; then \r\n\techo \"Complete: No Email = No Virus\" | \/usr\/bin\/logger -t fprot_mail -p daemon.err\t\r\nelse\r\n\tcat \/var\/log\/fprot.log | mailx -s \"F-Prot Scan Results\" ${email}\r\n\techo \"Complete: F-Prot Email Sent\" | \/usr\/bin\/logger -t fprot_mail -p daemon.err\r\nfi\r\n\r\nexit 0\r\n<\/pre>\nAfter adding the scripts to crontab. Contrab should look like this,<\/p>\n
0 3 * * * \/usr\/local\/f-prot\/tools\/check-updates.pl -cron -quiet
\n0 4 * * * \/home\/localuser\/scripts\/fprot_scan.sh \/dev\/null 2>&1
\n0 5 * * * \/home\/localuser\/scripts\/fprot_mail.sh \/dev\/null 2>&1<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"Here are 2 scripts created for the AV software F-Prot, FProt_scan Runs a scan on your system, you will need to enter you own path under the variable $path #!\/bin\/bash #Variables path=\/ #binaries fprot=\/usr\/local\/f-prot\/f-prot if [ ! -x “${fprot}” ]; then echo “Error: ${fprot} not found or not executable!” | \/usr\/bin\/logger -t fprot_scan -p daemon.err … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"yoast_head":"\n
BASH - F-Prot Scripts - Fir3net<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n