diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-05-20 21:16:26 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-05-20 21:16:26 +0000 |
commit | 6080784f5eb8bcae13436b3651726e91110d482e (patch) | |
tree | 6508110f0780c0396253b81de45349cfa8d44658 /packages/clamav.inc | |
parent | d97ba517bb20251fb3f542ca097dbe54c6b74ccd (diff) | |
download | pfsense-packages-6080784f5eb8bcae13436b3651726e91110d482e.tar.gz pfsense-packages-6080784f5eb8bcae13436b3651726e91110d482e.tar.bz2 pfsense-packages-6080784f5eb8bcae13436b3651726e91110d482e.zip |
Adding clamav and havp packages.
Submitted-by: Rajkumar S <raj_AT_linuxense.com>
Diffstat (limited to 'packages/clamav.inc')
-rw-r--r-- | packages/clamav.inc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/packages/clamav.inc b/packages/clamav.inc new file mode 100644 index 00000000..b63eb984 --- /dev/null +++ b/packages/clamav.inc @@ -0,0 +1,41 @@ +<?php +function sync_package_clamav() { + conf_mount_rw(); + config_lock(); + global $config; + $fd = fopen("/usr/local/etc/freshclam.conf","w"); + fwrite($fd, "DatabaseDirectory /var/db/clamav\n"); + fwrite($fd, "UpdateLogFile /var/log/clamav/freshclam.log\n"); + fwrite($fd, "DatabaseOwner clamav\n"); + fwrite($fd, "AllowSupplementaryGroups\n"); + fwrite($fd, "DatabaseMirror database.clamav.net\n"); + fclose($fd); + $cronjob = "*/120 * * * * root /usr/bin/nice -n20 /usr/local/bin/freshclam"; + add_text_to_file("/etc/crontab", $cronjob); + conf_mount_ro(); + config_unlock(); + mwexec("killall -HUP cron"); +} + +function clamav_install_command() { + global $config, $g; + mwexec ("mkdir -p /var/db/clamav"); + mwexec ("chown clamav:clamav /var/db/clamav/"); + mwexec ("chown clamav:clamav /var/log/clamav/"); + mwexec ("/usr/local/bin/freshclam"); + sync_package_clamav(); +} + +function clamav_deinstall_command() { + global $config, $g; + conf_mount_rw(); + unlink_if_exists("/usr/local/etc/rc.d/clamav.sh"); + unlink_if_exists("/var/db/clamav/daily.cvd"); + unlink_if_exists("/var/db/clamav/main.cvd"); + unlink_if_exists("/var/db/clamav"); + $cronjob = "*/120 * * * * root /usr/bin/nice -n20 /usr/local/bin/freshclam"; + #remove_text_to_file("/etc/crontab", $cronjob); + conf_mount_ro(); +} + +?> |