#var/ipfire/clamav
var/ipfire/clamav/clamd.conf
var/ipfire/clamav/freshclam.conf
+etc/rc.d/init.d/clamav
+/usr/local/bin/clamavctrl
cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/var/ipfire/clamav
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && make install
+ chown nobody.nobody /usr/share/clamav -R
@rm -rf $(DIR_APP)
@$(POSTBUILD)
--- /dev/null
+#!/bin/sh
+# Begin $rc_base/init.d/clamav
+
+. /etc/sysconfig/rc
+. $rc_functions
+
+case "$1" in
+ start)
+ boot_mesg "Starting Clamav Definition Updater..."
+ loadproc /usr/bin/freshclam -d -c 10
+
+ boot_mesg "Starting Clamav Daemon..."
+ loadproc /usr/sbin/clamd
+ ;;
+
+ stop)
+ boot_mesg "Stopping Clamav Definition Updater..."
+ killproc /usr/bin/freshclam
+
+ boot_mesg "Stopping Clamav Daemon..."
+ killproc /usr/sbin/clamd
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ statusproc /usr/sbin/clamd
+ statusproc /usr/bin/freshclam
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/clamav
restartsyslogd logwatch openvpnctrl timecheckctrl \
restartwireless getipstat qosctrl launch-ether-wake \
redctrl extrahdctrl sambactrl upnpctrl tripwirectrl \
- smartctrl
+ smartctrl clamavctrl
install : all
install -m 755 $(PROGS) /usr/local/bin
smartctrl: smartctrl.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ smartctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+clamavctrl: clamavctrl.c setuid.o ../install+setup/libsmooth/varval.o
+ $(COMPILE) -I../install+setup/libsmooth/ clamavctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+
launch-ether-wake: launch-ether-wake.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ launch-ether-wake.c setuid.o ../install+setup/libsmooth/varval.o -o $@
--- /dev/null
+/* This file is part of the IPFire Firewall.
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence. See the file COPYING for details.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include "setuid.h"
+
+int main(int argc, char *argv[]) {
+
+ if (!(initsetuid()))
+ exit(1);
+
+ if (argc < 2) {
+ fprintf(stderr, "\nNo argument given.\n\nclamavctrl (start|stop|restart)\n\n");
+ exit(1);
+ }
+
+ if (strcmp(argv[1], "start") == 0) {
+ safe_system("/etc/rc.d/init.d/clamav start");
+ } else if (strcmp(argv[1], "stop") == 0) {
+ safe_system("/etc/rc.d/init.d/clamav stop");
+ } else if (strcmp(argv[1], "restart") == 0) {
+ safe_system("/etc/rc.d/init.d/clamav restart");
+ } else if (strcmp(argv[1], "enable") == 0) {
+ safe_system("ln -fs ../init.d/clamav /etc/rc.d/rc3.d/S20clamav >/dev/null 2>&1");
+ safe_system("ln -fs ../init.d/clamav /etc/rc.d/rc0.d/K80clamav >/dev/null 2>&1");
+ safe_system("ln -fs ../init.d/clamav /etc/rc.d/rc6.d/K80clamav >/dev/null 2>&1");
+ } else if (strcmp(argv[1], "disable") == 0) {
+ safe_system("rm -f /etc/rc.d/rc*.d/*clamav >/dev/null 2>&1");
+ } else {
+ fprintf(stderr, "\nBad argument given.\n\nclamavctrl (start|stop|restart)\n\n");
+ exit(1);
+ }
+
+ return 0;
+}