# # check clamav accounts # if [ -z "`grep ^clamav /etc/group`" ]; then groupadd -g 203 clamav fi if [ -z "`grep ^clamav /etc/passwd`" ]; then useradd -u 203 -g 203 -s /bin/false -c "Clam AntiVirus" clamav fi # # Create pid directory # mkdir -p /var/{log,lib}/clamav chown clamav:clamav /var/{log,lib}/clamav # /sbin/ldconfig # Upgrade to rc.clamd init script. rm -f /etc/rc.d/rc0.d/K25clamd /etc/rc.d/rc1.d/K25clamd /etc/rc.d/rc3.d/S75clamd /etc/rc.d/rc4.d/S75clamd /etc/rc.d/rc6.d/K25clamd rm -f /etc/rc.d/init.d/clamd* rm -f /var/lib/pkgtools/setup/setup.clamd config() { NEW="$1" OLD="`dirname $NEW`/`basename $NEW .new`" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config etc/rc.d/rc.clamd.new