X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage3%2Fcis-clamav;h=902299d80eefcda655c0d0246a8a8671d7334a96;hb=5b913b7b528bb69a0c90583b8776d6d26b9cb189;hp=b76a00077ffbe7080593359f761548fe017a85d9;hpb=16cc35ba4890382ee9368a176e4f5a7fa773b7a6;p=hvlinux.git diff --git a/stage3/cis-clamav b/stage3/cis-clamav index b76a000..902299d 100755 --- a/stage3/cis-clamav +++ b/stage3/cis-clamav @@ -1,4 +1,6 @@ #!/bin/sh +set -o errexit + # First argument of this script is the package name # Reading system configuration informations, functions and package versions. @@ -6,35 +8,33 @@ source ../sysinfos source ../functions source ../packages-list -CUR_DIR=$(pwd) - # Applying patches (if any) -apply_patches ${1} && +apply_patches ${1} -hv_groupadd clamav && -hv_useradd -g clamav -s /bin/false -c Clam-AntiVirus clamav && +hv_groupadd clamav +hv_useradd -g clamav -s /bin/false -c Clam-AntiVirus clamav -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${1} SENDMAIL="/usr/sbin/sendmail" ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --with-dbdir=/srv/clamav \ - --enable-milter && -make && -make install && -touch /var/log/clamd.log && -chmod 600 /var/log/clamd.log && -chown clamav /var/log/clamd.log && -touch /var/log/freshclam.log && -chmod 600 /var/log/freshclam.log && -chown clamav /var/log/freshclam.log && + --enable-milter +make +make install +touch /var/log/clamd.log +chmod 600 /var/log/clamd.log +chown clamav /var/log/clamd.log +touch /var/log/freshclam.log +chmod 600 /var/log/freshclam.log +chown clamav /var/log/freshclam.log # Addition to /etc/fcron/fcrontab to update virus database -string_add "Update the Clam AV database every hour" /etc/fcron/fcrontab && -string_add "&mail(false) 0 * * * * /usr/bin/freshclam --quiet" /etc/fcron/fcrontab && +string_add "Update the Clam AV database every hour" /etc/fcron/fcrontab +string_add "&mail(false) 0 * * * * /usr/bin/freshclam --quiet" /etc/fcron/fcrontab # Configuration file -cat > /etc/clamd.conf << "EOF" && +cat > /etc/clamd.conf << "EOF" # clamd.conf # Configuration file for the Clam AV daemon @@ -150,7 +150,7 @@ EOF # Freshclam configuration file -cat > /etc/freshclam.conf << "EOF" && +cat > /etc/freshclam.conf << "EOF" # freshclam.conf # Configuration file for Freshclam @@ -195,20 +195,19 @@ DatabaseMirror database.clamav.net EOF # Create the DB directory -mkdir -p /srv/clamav && -chown clamav:clamav /srv/clamav && -chmod 755 /srv/clamav && +mkdir -p /srv/clamav +chown clamav:clamav /srv/clamav +chmod 755 /srv/clamav # Create the run directory -mkdir -p /var/run/clamav && -chown clamav:clamav /var/run/clamav && -chmod 755 /var/run/clamav && +mkdir -p /var/run/clamav +chown clamav:clamav /var/run/clamav +chmod 755 /var/run/clamav # Bootscript -install -v -m740 ${CUR_DIR}/bootscripts/clamav /etc/rc.d/init.d && +install -v -m740 ${SCRDIR}/bootscripts/clamav /etc/rc.d/init.d # script-name start stop bootscript_add_rc3 clamav 55 35 -# Return last error exit $?