ClamAV update to 0.90 made easy?

Discussion in 'Tips/Tricks/Mods' started by rbartz, Feb 14, 2007.

  1. rbartz

    rbartz Member HowtoForge Supporter

    In the Developers Forum, there is a script written by George Vieira and modified by djtremors for ISPC that would update CLAMAV definitions automatically (when run regularly by a cron job) and even upgrade the clamav program if there is a new one.

    http://www.howtoforge.com/forums/showthread.php?t=7937

    I wanted to update my clamav installation to the newest one today, so I tried the script. I had to make a few minor changes for my OS, but it worked fine and upgraded my clamav installation in ispconfig from 0.88.7 to 0.90.

    Here is the original script:

    Code:
    #!/bin/bash
    # Version 1.01 by George Vieira
    
    # place your ISPC admin email address here.
    ADMIN="[email protected]"
    
    # place your preferred mirror server here.
    MIRROR="http://optusnet.dl.sourceforge.net/sourceforge/clamav"
    
    # -- Nothing to change under this line -----------------------------
    LOG="/var/log/clamav-prog-update.log"
    APPLICATION_NAME=ispconfig
    COMPILE_DIR=`pwd`
    
    error()
    {
            if [ "$ADMIN" ]; then
                    echo "Subject:CLAMUPDATE: $1" | sendmail "$ADMIN"
            else
                    echo "Subject:CLAMUPDATE: $1" | sendmail root
            fi
    }
    
    findversion()
    {
            VERSION="`host -t txt current.cvd.clamav.net | sed -e 's/"//g' |cut -d ' ' -f 4|cut -d : -f 1`"
            [ "$?" != 0 ] && ( echo "Error with finding new version off clamav.net site. URL may have changed!";exit 1;)
    
            echo "DETECTED VERSION -> $VERSION" >>$LOG 2>&1
    
    }
    
    if [ ! -f /var/log/clam-update.log ]; then
            touch /var/log/clam-update.log
            chown admispconfig /var/log/clam-update.log
            chmod 660 /var/log/clam-update.log
    fi
    
    STATUS="`/home/admispconfig/ispconfig/tools/clamav/bin/freshclam --log=/var/log/clam-update.log 2>&1`"
    
    NEW="`echo \"$STATUS\" | grep \"WARNING: Local version\" | awk {'print $7'}`"
    OLD="`echo \"$STATUS\" | grep \"WARNING: Local version\" | awk {'print $4'}`";
    NEWUPDATE="`echo \"$STATUS\" |grep \"Current functionality level\"`"
    
    [ "$NEWUPDATE" ] && NEW="`findversion`"
    
    # If there's a NEW one, updated it.
    if [ "$NEW" ]; then
            mkdir /root/ispc.updates 2>/dev/null
            cd /root/ispc.updates
    
            if [ -d "clamav-$OLD" ]; then
                    rm -fr "clamav-$OLD"
            fi
    
            webget -c $MIRROR/clamav-$NEW.tar.gz >>$LOG 2>&1
            RESULT=$?
    
            if [ $RESULT = 0 ]; then
                    tar xvfz clamav-$NEW.tar.gz >/dev/null 2>&1
                    cd "clamav-$NEW"
    
                    ./configure --prefix=/home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav
                            --sysconfdir=/home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav/etc
                            --with-user=adm${APPLICATION_NAME} --with-group=adm${APPLICATION_NAME}
                            --disable-clamav --disable-bzip2 >>$LOG 2>&1 || error "Could not configure ClamAV"
                    make || error "Could not make ClamAV"
                    make install || error "Could not install ClamAV"
                    cp -f COPYING /home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav/
                    cd ${COMPILE_DIR}
                    cp -f clamav.conf /home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav/etc/clamav.conf
                    cp -f freshclam.conf /home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav/etc/freshclam.conf
                    rm -f /home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav/etc/clamd.conf
                    cd /home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav/etc/
                    ln -s clamav.conf clamd.conf
                    cd ${COMPILE_DIR}
    
                    # Bit of a shame we have to restart ALL the ISPC services and not only freshclam
                    /etc/rc.d/init.d/ispconfig_server restart
    
                    error "Updated from OLD=$OLD -> NEW=$NEW"
            else
                    error "Cannot fetch new CLAMAV version, check mirror address"
            fi
    fi
    In order for this to work on my Fedora Core 4 server, I had to change the sendmail on lines 18 and 20 to "/usr/sbin/sendmail" and to change "webget" on line 56 to "wget". I also had to create a "clamav" user and "clamav" group.

    All you do from there is to save the file on your server (I named it "getfreshclam"), chmod it 0755, and run it while you are root.

    It checked my old version, checked for newest one, went and got the new install tar and installed it. THANKS GEORGE and DJTREMORS.... I no longer need to wait for an ispconfig update to freshen my clamav installation!

    NOTE that on my Fedora Core 3 server, I did not get the same value for $VERSION. I had to change "|cut -d ' ' -f 4" to "|cut -d ' ' -f 3" to get the version number. Even then, the line [ "$NEWUPDATE" ] && NEW="`findversion`" failed to reassign $NEW so the script fails on FC3. In other words, the script may not work on your OS... you may need to adjust a few things! Use it at your own risk!

    Cheers,

    RDB
     
    Last edited: Feb 14, 2007
  2. smartcall

    smartcall ISPConfig Developer ISPConfig Developer

    Thanks.

    Very nice how-to. I use FC6, I tried the script, but unfortunately the line
    Code:
    [ "$NEWUPDATE" ] && NEW="`findversion`"
    does not work for me.

    I updated

    Code:
    NEW="`echo \"$STATUS\" | grep \"WARNING: Local version\" | awk {'print $7'}`"
    OLD="`echo \"$STATUS\" | grep \"WARNING: Local version\" | awk {'print $4'}`";
    NEWUPDATE="`echo \"$STATUS\" |grep \"Current functionality level\"`"
    to
    Code:
    NEW="`echo "$STATUS" | grep "WARNING: Local version" | awk {'print $7'}`"
    OLD="`echo "$STATUS" | grep "WARNING: Local version" | awk {'print $4'}`";
    NEWUPDATE="`echo "$STATUS" | grep "Current functionality level"`"
    Because it wasn't working at all.
    After that it was able to do it to the point of
    Code:
    [ "$NEWUPDATE" ] && NEW="`findversion`"
    and nothing more happend

    If you have any Idea why, I would appreciate it very much.

    Regards
     
  3. rbartz

    rbartz Member HowtoForge Supporter

    Better findversion...

    The problem may be in the 'findversion' function

    Try changing the VERSION= line to

    Code:
    VERSION="`host -t txt current.cvd.clamav.net |cut -d '\"' -f 2 |cut -d : -f 1`"
    That seems to return the current version more reliably, at least on my RH7.2 FC3 and FC4 boxes.

    As I stated above, the script might not work "out of the box" for all OS. Even the output of "host -t txt current.cvd.clamav.net" was different between my FC3 and FC4 boxes... weird! Thus the change in the function to better determine the current version available.

    Check /var/log/clam-update.log and /var/log/clamav-prog-update.log to see what is happening when you run the script as well. You can add lines like

    echo "OLD VERSION -> $OLD" >>$LOG 2>&1
    echo "NEW VERSION -> $NEW" >>$LOG 2>&1

    or

    echo "NEWUPDATE-> $NEWUPDATE" >>$LOG 2>&1

    to to the script after the lines that assign the values. Then you can see what kind of output you are getting when the script runs in the logs. If you get past the [ "$NEWUPDATE" ] && NEW="`findversion`" line, and a new version is avaliable, it will update your installation. You will see the progress on screen...

    Cheers,

    RDB
     
  4. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    Hey all, I just noticed this long post which I didn't realise how many were actually using it.

    Yeah I noticed there were some bugs and possibly differences in distros which could cause problems. I use bash and Fedora so I don't know how many others would have issues.

    btw, George Vieira and djtremors are the same person ;)

    The reason for the way the script was originally written the way it was is because I detected the pattern and version changes during a virus pattern update when it returns a
    PHP:
    WARNINGLocal version X.XX.......
    so I acted on it to get an update.

    Problem later came when I noticed it wasn't working at all properly and found that a major release was on the internet but the WARNING message didn't trigger it so the only way was to get on the site itself.

    Now instead of waiting for major downloads each time, i tried to get minor release builds in 1 method and do major builds in another... and ended up with a patchy bit og shell script scratched up at 1am..lol

    I've been thinking of redoing it in PHP as PHP has a (works on any Linux) ability and text manipulation to make it always work (unless the mirror fail or the url data returned is changed, etc.etc..)

    Anybody want me to write a PHP version to use let me know by PM or va my website below.
     
  5. radim_h

    radim_h Member HowtoForge Supporter

    update error

    I tried your script but it stops on

    checking for clamav in /etc/passwd... no
    configure: error: User clamav (and/or group clamav) doesn't exist. Please read the documentation !
    ./freshclam.sh: line 64: --sysconfdir=/home/admispconfig/ispconfig/tools/clamav/etc: No such file or directory
    ./freshclam.sh: line 65: --with-user=admispconfig: command not found
    make: *** No targets specified and no makefile found. Stop.
    make: *** No rule to make target `install'. Stop.
    cp: cannot stat `clamav.conf': No such file or directory
    cp: cannot stat `freshclam.conf': No such file or directory
    Shutting down ISPConfig system...
    /root/ispconfig/httpd/bin/apachectl stop: httpd stopped
    ISPConfig system stopped!
    Starting ISPConfig system...

    what should i fix ? directory /home/admispconfig/ispconfig/tools/clamav/etc exists on my system...

    using FC6
     
    Last edited: May 13, 2007
  6. falko

    falko Super Moderator ISPConfig Developer

    The command

    must go into one line:

    Code:
    ./configure --prefix=/home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav --sysconfdir=/home/adm${APPLICATION_NAME}/${APPLICATION_NAME}/tools/clamav/etc --with-user=adm${APPLICATION_NAME} --with-group=adm${APPLICATION_NAME} --disable-clamav --disable-bzip2 >>$LOG 2>&1 || error "Could not configure ClamAV"
     
  7. radim_h

    radim_h Member HowtoForge Supporter

    thanks!!

    at the end it says
    cp: cannot stat `clamav.conf': No such file or directory
    cp: cannot stat `freshclam.conf': No such file or directory
    Shutting down ISPConfig system...

    but it seems that Clamav was updated...
     
  8. radim_h

    radim_h Member HowtoForge Supporter

    Well,
    weird thing is that logwatch is still sending
    --------------------- clam-update Begin ------------------------

    Last ClamAV update process started at Mon May 14 18:38:27 2007

    Last Status:
    SECURITY WARNING: NO SUPPORT FOR DIGITAL SIGNATURES
    See the FAQ at http://www.clamav.net/support/faq for an explanation.
    WARNING: Your ClamAV installation is OUTDATED!
    WARNING: Local version: 0.90.1 Recommended version: 0.90.2
    DON'T PANIC! Read http://www.clamav.net/support/faq
    main.inc is up to date (version: 43, sigs: 104500, f-level: 14, builder: sven)
    daily.inc is up to date (version: 3243, sigs: 11528, f-level: 15, builder: ccordes)

    ---------------------- clam-update End -------------------------
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    This logwatch entry is most likely not from ISPConfig. Please check that you have no clamav pacakge from your linux distribution installed.
     
  10. radim_h

    radim_h Member HowtoForge Supporter

    it was from ispconfig (IMHO, i have not clamav installation thru yum on the system), but dissapeared after server reboot.
    It robably needs postfix reload or some other service restart..
     
  11. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    I'm actually rewriting this script in php. the reason, more stable between distros so no problems with sending emails or splitting the output using 'cut' between distros, none of that... just works.

    It's a straight port over with little tweaks and come security checking (ie making sure what the clamav guys send us as a new update is actually numeric and not a script ;) )

    will wait for some new clam updates so I can do some testing (have been faking it with text outputs but want to test full compile etc now).....

    djtremors.
     
  12. davy

    davy New Member

    I am using CentOS 5.1(86_64).i got an error when i run this script.

    [root@server1 ~]# ./clamav_update
    ./clamav_update: line 62: cd: clamav-0.92: No such file or directory
    make: *** No targets specified and no makefile found. Stop.
    make: *** No rule to make target `install'. Stop.
    cp: cannot stat `COPYING': No such file or directory
    cp: cannot stat `clamav.conf': No such file or directory
    cp: cannot stat `freshclam.conf': No such file or directory
    Shutting down ISPConfig system...
    /root/ispconfig/httpd/bin/apachectl stop: httpd stopped
    ISPConfig system stopped!
    Starting ISPConfig system...
    /root/ispconfig/httpd/bin/apachectl startssl: httpd started
    ISPConfig system is now up and running!

    How can i fix it?

    Thanks alot.
     
  13. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    That script doesn't do a heck of alot of checking and usually just works out of the box for me.. it was something is quickly created, then modified due to some other clam alerts i wasn't aware of and then got a little messy.

    I've written a PHP version which hopefully will just work on every distro so you just need to make sure you have commands like tar installed.
    it's not verbose on the command line at the moment but does the job and sends an email on errors or completion.

    give it a try and let me know how you go. I did have some code there which could make the script auto update itself incase of fixes/updates but it's not only not used but i later thought people would worry about it's security so I cancelled going further. It was only going to allow to download and alert to change to the new script (not actually call it ever)..

    anyhow, give it a try and let me know of problems. My direct email is in the file.

    http://www.djtremors.com/downloads/clamavupdate.php.txt (remove .txt after download of course ;) )
    md5 0cab5eefc10ace6deead547dce817c95
     
    Last edited: Jan 1, 2008
  14. davy

    davy New Member

    I did run the above script.the error is below.

    [root@server1 ~]# ./clamavupdate.php
    ./clamavupdate.php: line 1: ?php: No such file or directory
    ./clamavupdate.php: line 9: [admin]: command not found
    ./clamavupdate.php: line 12: [mirror][]: command not found
    ./clamavupdate.php: line 13: [mirror][]: command not found
    ./clamavupdate.php: line 16: [logfreshclam]: command not found
    ./clamavupdate.php: line 17: [logupdater]: command not found
    ./clamavupdate.php: line 18: [application_name]: command not found
    ./clamavupdate.php: line 19: syntax error near unexpected token `('
    ./clamavupdate.php: line 19: `$conf['compile_dir'] = getcwd();'
    [root@server1 ~]#

    Please help.

    Thanks alot.
     
  15. falko

    falko Super Moderator ISPConfig Developer

    Can you post the contents of your clamavupdate.php script?
     
  16. davy

    davy New Member

    Script detail on below:



    <?php

    # ClamAVupdate - By George (djtremors) Vieira
    # projects (@) djtremors (.) com
    #
    # V1.0 - First PHP version release

    # place your ISPC admin email address here.
    $conf['admin'] = "[email protected]";

    # place your preferred mirror server here above the rest which are for backup.
    $conf['mirror'][] = "http://easynews.dl.sourceforge.net/sourceforge/clamav";
    $conf['mirror'][] = "http://optusnet.dl.sourceforge.net/sourceforge/clamav";

    # -- Nothing to change under this line -----------------------------
    $conf['logfreshclam'] = '/var/log/clamav-fresh-update.log';
    $conf['logupdater'] = '/var/log/clamav-updater.log';
    $conf['application_name'] = 'ispconfig';
    $conf['compile_dir'] = getcwd();
    $conf['hostname'] = posix_uname();

    # -- If you allow auto script updates, this is where it gets it from.
    $conf['script_update_host'] = 'clamav_updater_host.djtremors.com';
    $conf['script_version'] = '1.0';
    $conf['script_last_update'] = '000000';

    function loadconf()
    {
    global $conf;
    if ( is_file('/root/ispc.updates/clamav-update.conf') )
    {
    $loadconf = file_get_contents('/root/ispc.updates/clamav-update.conf');
    if ( $checkconf = @unserialize($loadconf) )
    $conf = $checkconf;
    }
    }

    function saveconf()
    {
    global $conf;

    $fw = fopen('/root/ispc.updates/clamav-update.conf','w');
    if ($fw)
    {
    fwrite($fw,serialize($conf));
    fclose($fw);
    }
    }

    #
    # Main
    #
    // Load changes and updates from last update run.
    loadconf();
    $conf['admin'] = "[email protected]";
    // Check for script update and notify availability.
    get_script_update_check();
    // Do clamav check and compile/update if needed.
    update_pattern();
    // Save changes to disk.
    saveconf();

    function get_script_update_check()
    {
    global $conf;

    if ( time() - $conf['script_last_update'] < 2592000 )
    {
    log_message('ClamAV-updater check already done within the last week, ignored.');
    return false;
    }

    if ( ! function_exists('dns_get_record') )
    error('PHP version required', 'PHP needs to be version 5.X to support dns_get_record() method or a workaround is needed.', 1);

    $dns_record = dns_get_record($conf['script_update_host'], DNS_TXT);
    if ( isset($dns_record['txt'] ) )
    {
    $dns_record = dns_get_record($conf['script_version'], DNS_TXT);
    if ( isset($dns_record['txt'] ) )
    {
    $check_ver = $dns_record['txt'];
    if ( $check_ver != $conf['script_version'] )
    log_message('ClamAV-updater script new version detected : '.$check_ver);
    }
    }
    else
    log_message('ClamAV-updater script cannot find updater host. May have moved and this version did not update that move.');
    }

    function error( $subject, $message, $exit_status)
    {
    global $conf;

    log_message( $subject." ".$message );

    if ( $conf['admin'] )
    mail($conf['admin'], 'CLAMAVUPDATE('.$conf['hostname']['nodename'].'): '.$subject, $message);
    else
    mail('root', 'CLAMAVUPDATE('.$conf['hostname']['nodename'].'): '.$subject, $message);

    exit($exit_status);
    }

    function get_major_release()
    {
    if ( function_exists("dns_get_record") )
    $dns_record = dns_get_record("current.cvd.clamav.net",DNS_TXT);
    else
    error('PHP version required', 'PHP needs to be version 5.X to support dns_get_record() method or a workaround is needed.', 1);
    /*
    Array
    (
    [0] => Array
    (
    [host] => current.cvd.clamav.net
    [type] => TXT
    [txt] => 0.92:45:5249:1198625341:1
    [class] => IN
    [ttl] => 182
    )
    )
    */

    if ( count($dns_record) == 0 || ! isset($dns_record[0]['txt']) )
    error('Major ClamAV DNS record check failed.', 'The updater could not resolve or find the TXT record for "current.cvd.clamav.net".', 1);

    $split = split(":",$dns_record[0]['txt']);
    preg_match_all("/[0-9]{1,2}\.[0-9]{1,3}\.[0-9]{1,2}|[0-9]{1,2}\.[0-9]{1,3}/",$split[0],$output,PREG_PATTERN_ORDER);

    if ( isset($output[0][0]) )
    {
    log_message('ClamAV website release check reports version : '.$output[0][0]);
    return $output[0][0];
    }
    else
    {
    log_message('ClamAV website release check was not successful');
    return false;
    }
    }

    function log_message($message)
    {
    global $conf;

    if ( ! is_file($conf['logfreshclam']) )
    {
    $fw = fopen($conf['logfreshclam'],'a');
    if ( $fw )
    {
    fputs($fw, date("Y/m/d H:i:s")." : ".$message."\n");
    fclose($fw);
    }
    }
    }

    function update_pattern()
    {
    global $conf;

    if ( ! is_file($conf['logfreshclam']) )
    {
    $fw=fopen($conf['logfreshclam'],'w');
    fclose($fw);
    chown($conf['logfreshclam'],'admispconfig');
    chmod($conf['logfreshclam'], 0750);
    }
    exec('/home/admispconfig/ispconfig/tools/clamav/bin/freshclam --log='.$conf['logfreshclam'].' 2>&1', $output, $retval);

    status_check($output);
    }

    function status_check($output)
    {
    /*
    Array
    (
    [0] => ClamAV update process started at Wed Dec 26 13:29:55 2007
    [1] => SECURITY WARNING: NO SUPPORT FOR DIGITAL SIGNATURES
    [2] => See the FAQ at http://www.clamav.net/support/faq for an explanation.
    [3] => WARNING: Your ClamAV installation is OUTDATED!
    [4] => WARNING: Local version: 0.91.2 Recommended version: 0.92
    [5] => DON'T PANIC! Read http://www.clamav.net/support/faq
    [6] => main.inc is up to date (version: 45, sigs: 169676, f-level: 21, builder: sven)
    Downloading daily-5250.cdiff [100%]diff [100%]
    Downloading daily-5251.cdiff [100%]diff [100%]
    Downloading daily-5252.cdiff [100%]diff [100%]
    [10] => daily.inc updated (version: 5252, sigs: 11342, f-level: 21, builder: ccordes)
    [11] => Database updated (181018 signatures) from database.clamav.net (IP: 193.1.193.64)
    [12] => sh: chmod -R 755 /home/admispconfig/ispconfig/tools/clamav/share/clamav: No such file or directory
    [13] => sh: chmod -R 755 /home/admispconfig/ispconfig/tools/clamav/share/clamav: No such file or directory
    )*/
    if ( count($output) > 0 )
    {
    if ( substr($output[0],0,6) == "ClamAV" )
    {
    foreach($output as $key => $line)
    {
    $line=trim($line);

    if ( $line == "WARNING: Your ClamAV installation is OUTDATED!" )
    update_clamav();

    if ( is_numeric(strpos($line,"Downloading daily")) )
    print_r($output);
    }
    }
    }
    }

    function build_new_clamav($ver)
    {
    global $conf;

    if ( ! is_dir('/root/ispc.updates') )
    {
    mkdir('/root/ispc.updates');
    mkdir('/root/ispc.updates/clamav/');
    }
    system('rm -fr /root/ispc.updates/clamav/*');

    $fw = fopen('/root/ispc.updates/clamav/clamav.tar.gz','w');
    foreach($conf['mirror'] as $key => $url)
    {
    if ( fwrite($fw, file_get_contents($url.'/clamav-'.$ver.'.tar.gz')) )
    {
    $download_ok=true;
    break;
    }
    }
    fclose($fw);
    if ( ! $download_ok )
    error("Mirror download problems", "Could not fetch updated clamav from any of the mirrors.", 1);

    if ( system('cd /root/ispc.updates/clamav/; tar xfz clamav.tar.gz') != 0 )
    error("ClamAV extraction failed","Extracting the tar.gz file produced an error, check if it happens again on next run.",1);

    if ( system('cd /root/ispc.updates/clamav/clamav-'.$ver.'; ./configure --prefix=/home/adm'.$conf['application_name'].'/'.$conf['application_name'].'/tools/clamav --sysconfdir=/home/adm'.$conf['application_name'].'/'.$conf['application_name'].'/tools/clamav/etc --with-user=adm'.$conf['application_name'].' --with-group=adm'.$conf['application_name'].' --disable-clamav --disable-bzip2 >/root/ispc.updates/clamav/compile.err 2>&1') != 0 )
    error("ClamAV configure failed failed","configuring new version of ClamAV failed. Check the /root/ispc.updates/clamav/compile.err file.",1);

    if ( system('cd /root/ispc.updates/clamav/clamav-'.$ver.'; make >/dev/null 2>>/root/ispc.updates/clamav/compile.err') != 0)
    error("ClamAV configure failed failed","compiling new version of ClamAV failed. Check the /root/ispc.updates/clamav/compile.err file.",1);

    if ( system('cd /root/ispc.updates/clamav/clamav-'.$ver.'; make install >/dev/null 2>>/root/ispc.updates/clamav/compile.err') )
    error("ClamAV configure failed failed","installing new version of ClamAV failed. Check the /root/ispc.updates/clamav/compile.err file.",1);

    log_message('ISPConfig server being restarted...');
    system('/etc/rc.d/init.d/ispconfig_server restart');

    error("ClamAV update completed","New version is $ver", 0);

    }

    function update_clamav()
    {
    log_message('Freshclam is reporting ClamAV is outdated, attempting to download new version.');
    $ver = get_major_release();
    if ( $ver )
    build_new_clamav($ver);
    }

    ?>
     
  17. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    Don't use the posted version as this can lead to busted code due to copy/paste.

    It's a PHP script not shell script... call it using

    php ./clamavupdate.php
     
  18. davy

    davy New Member

    I still got error:

    [root@dns1 ~]# php ./clamavupdate.php
    PHP Warning: fopen(/root/ispc.updates/clamav-update.conf): failed to open stream: No such file or directory in /root/clamavupdate.php on line 42
    [root@dns1 ~]# php ./clamavupdate.php

    clamav-fresh-update.log file is on below:

    2008/01/03 18:12:24 : ClamAV-updater script cannot find updater host. May have moved and this version did not update that move.


    Please help. Thanks alot.
     
  19. djtremors

    djtremors ISPConfig Developer ISPConfig Developer

    Argh, sorry again. Small bug fixes. Please download it again from the same url which is now version 1.1

    I have also fixed some DNS checking for script updates and logging issues too which was a bugger up.

    I appreciate the feedback as it helps me help others.
     
  20. davy

    davy New Member

    I check my maillog but clamav sill cannot be updated yet.

    [root@dns1 ~]# tail -f /var/log/maillog
    Jan 5 15:08:38 dns1 freshclam[3394]: Received signal: wake up
    Jan 5 15:08:38 dns1 freshclam[3394]: ClamAV update process started at Sat Jan 5 15:08:38 2008
    Jan 5 15:08:38 dns1 freshclam[3394]: SECURITY WARNING: NO SUPPORT FOR DIGITAL SIGNATURES
    Jan 5 15:08:38 dns1 freshclam[3394]: See the FAQ at http://www.clamav.net/support/faq for an explanation.
    Jan 5 15:08:38 dns1 freshclam[3394]: Your ClamAV installation is OUTDATED!
    Jan 5 15:08:38 dns1 freshclam[3394]: Local version: 0.91.2 Recommended version: 0.92
    Jan 5 15:08:38 dns1 freshclam[3394]: DON'T PANIC! Read http://www.clamav.net/support/faq
    Jan 5 15:08:38 dns1 freshclam[3394]: main.inc is up to date (version: 45, sigs: 169676, f-level: 21, builder: sven)
    Jan 5 15:08:38 dns1 freshclam[3394]: daily.inc is up to date (version: 5368, sigs: 16527, f-level: 21, builder: ccordes)
    Jan 5 15:08:38 dns1 freshclam[3394]: --------------------------------------

    clamav-fresh-update.log:
    2008/01/03 18:12:24 : ClamAV-updater script cannot find updater host. May have moved and this version did not update that move.
    2008/01/05 11:56:56 : ClamAV-updater script version check is up to date.
    2008/01/05 11:59:25 : ClamAV-updater check already done within the last week, ignored.
    2008/01/05 12:08:11 : ClamAV-updater check already done within the last week, ignored.
    2008/01/05 12:22:15 : ClamAV-updater check already done within the last week, ignored.
    2008/01/05 15:10:17 : ClamAV-updater check already done within the last week, ignored.

    Thanks for help.
     

Share This Page