{"id":93,"date":"2010-01-02T12:14:31","date_gmt":"2010-01-02T11:14:31","guid":{"rendered":"http:\/\/www.ms-mueller.ch\/wp\/?p=93"},"modified":"2010-01-02T12:14:31","modified_gmt":"2010-01-02T11:14:31","slug":"clamav-mit-mailfunktion","status":"publish","type":"post","link":"https:\/\/www.ms-mueller.ch\/?p=93","title":{"rendered":"ClamAV mit Mailfunktion"},"content":{"rendered":"<p>Also heute hatte ich das Problem ClamAv dazu zu bringen das ich jede Woche einen Pr\u00fcfungsbericht bekommen und falls ein Virus gefunden wird ich auf unter der Woche informiert werden.<\/p>\n<p>So ist mein Vorschlag, da ich etwas in php bewandert bin habe ich das Shellskript in php geschrieben:<\/p>\n<pre class=\"brush:php\">#!\/usr\/bin\/php5\n&lt;?php\nexec(\"\/usr\/bin\/clamscan -ri \/\",$data);\n\n$found = true;\nforeach($data as $line)\n{\n        if(preg_match(\"\/^Infected files:\/\",$line))\n        {\n                $count = str_replace(\"Infected files: \",\"\",$line);\n                \/\/ Ich habe auf dem Rechne 4 beispielviren zum Testen diese m\u00fcssen nat\u00fcrlich ignoriert werden.\n                if($count == 4) $found = false;\n        }\n        $message .= $line . \"\\n\";\n}\n\nif($found || date(\"D\") == \"Sat\")\n{\n       if($found)\n       {\n               $betreff = \"Virus found !!!!\";\n       } else {\n               $betreff = \"Scan okay\";\n       }\n\n       $header = 'From: root@example.ch' . \"\\r\\n\" .\n                 'Reply-To: info@example.ch' . \"\\r\\n\" .\n                 'X-Mailer: PHP\/' . phpversion();\n       mail(\"info@example.ch\",$betreff,$message);\n}\n?&gt;\n\n\n<\/pre>\n<p>Das noch per link im \/etc\/cron.daily\/ ablegen und nun werde ich jeden Sa informiert das noch alles in Ordnung ist.<\/p>\n<p>Gruss Marco<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Also heute hatte ich das Problem ClamAv dazu zu bringen das ich jede Woche einen Pr\u00fcfungsbericht bekommen und falls ein Virus gefunden wird ich auf unter der Woche informiert werden. So ist mein Vorschlag, da ich etwas in php bewandert bin habe ich das Shellskript in php geschrieben: #!\/usr\/bin\/php5 &lt;?php exec(&#8222;\/usr\/bin\/clamscan -ri \/&#8220;,$data); $found = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"_links":{"self":[{"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93"}],"version-history":[{"count":0,"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ms-mueller.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}