Add Custom source to IPCOP Cache (Avira, Malwarebytes) [tut]

Discussion in 'PFsense M0n0wall IPcop & others PC based routers' started by Deeza, Nov 13, 2010.


  1. Deeza

    Deeza staff Staff Member




    Inorder to cache updates with IPCOP you need to download and install the update accelerator plugin. By default the plugin will cache Adobe, Apple, Avast, Linux (deb/rpm), Microsoft, Symantec and Trend Micro updates. While this is a pretty good list of vendors there might be situations where you need to cache other updates, for example if you are using the free version of Avira, you might wish to cache the updates for that.

    Firstly, what you need to do is figure out where the updates are being downloaded from. In this example I will be adding Avira Free edition to the update caching list. In my case Avira gets all its updates from http://dl[0-9].avgate.net. If you are unsure of where your updates are being downloaded from URL Helper is a great utility to use, as this will also tell you which extensions are being downloaded which will be usefull later on.

    Once you have figured out where the updates are coming from, the editing can begin. For all my editing I used the portable version of WinSCP, remeber to enable ssh first on your ip cop box by going System > SSH Access > Tick SSH Access and click save. Next fire up WinSCP and fill in the details related to your installation of IPCOP. Remeber to use port 222 instead of 22.

    Next you want to browse to /usr/sbin/updxlrator and edit it. By default WinSCP opens up the root directory so you may have to click the .. at the top to get to the previous directory level. Right click on the file and click edit. This should open up WinSCP‘s default editor.

    Find the Section of the file which says something like:
    Code:
    # -----------------------------------------------------------
    # Section: Windows Update / Windows Downloads
    # -----------------------------------------------------------
    This is where you custom code will go, In my case I just copied the Avast coding and changed it to where Avira gets its updates.

    To do that copy the Avast coding ..
    Code:
    # -----------------------------------------------------------
    # Section: Avast Downloads
    # -----------------------------------------------------------if ($source_url =~ [email]m@^[url]http://download[/url][\d]+\.avast\.com[/email]/.*\.(exe|vpu)[email protected])
    {
    $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avast",$mirror);
    }# -----------------------------------------------------------
    and paste it just above the # ———————————————————– line. In my case with Avira I needed to change the source url line of $source_url =~ m@^[url]http://download[/url][\d]+\.avast\.com/.*\.(exe|vpu)[email protected] to look something like $source_url =~ m@^[url]http://dl[/url][0-9]\.avgate\.net/.*\.(exe|dll|vdf|dat|gz)[email protected] the rest of the coding remains unchanged. You may want to change the vendor ID to “Other” though otherwise you will need to do a few more edits to get everything working correctly.

    So my finished section looks like this (no custom vendor logo):
    Code:
    # -----------------------------------------------------------
    # Section: Avast Downloads
    # -----------------------------------------------------------if ($source_url =~ [email]m@^[url]http://download[/url][\d]+\.avast\.com[/email]/.*\.(exe|vpu)[email protected])
    {
    $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avast",$mirror);
    }# -----------------------------------------------------------
    # -----------------------------------------------------------
    # Section: Avira Downloads
    # -----------------------------------------------------------
    
    if ($source_url =~ [email]m@^[url]http://dl[/url][0-9]\.avgate\.net[/email]/.*\.(exe|dll|vdf|dat|gz)[email protected])
    
    {
    $xlrator_url = &check_cache($source_url,$hostaddr,$username,"Other",$mirror);
    }
    
    # -----------------------------------------------------------
    
    }
    If you don’t want custom logo for the updates you are trying to cache then you are pretty much done at this point, if you would like to add custom logo and vendor ID then continue reading.

    Change “Other” to “Avira” save and close the file. Next you will need to open up /home/httpd/cgi-bin/updatexlrator.cgi and perform the following edits:

    Find:
    Code:
    elsif ($vendorid =~ /^Microsoft$/i)
    {
    print "[img]/images/updxl-src-windows.gif[/img]</td>\n";
    }
    
    After Add:
    elsif ($vendorid =~ /^Avira$/i)
    {
    print "[img]/images/updxl-src-avira.gif[/img]</td>\n";
    }
    Final Result:
    Code:
    elsif ($vendorid =~ /^Microsoft$/i)
    {
    print "[img]/images/updxl-src-windows.gif[/img]</td>\n";
    }elsif ($vendorid =~ /^Avira$/i)
    {
    print "[img]/images/updxl-src-avira.gif[/img]</td>\n";
    }
    Next Find:
    Code:
    elsif ($vendorid =~ /^Microsoft$/i)
    {
    print "[img]/images/updxl-src-windows.gif[/img]</nobr></td>\n";
    print "<td class='base'>Microsoft</td>\n";
    }
    After Add:
    Code:
    elsif ($vendorid =~ /^Avira$/i)
    {
    print "[img]/images/updxl-src-avira.gif[/img]</nobr></td>\n";
    print "<td class='base'>Avira Antivirus</td>\n";
    }
    Find:
    Code:
    elsif ($vendorid =~ /^Microsoft$/i)
    {
    print "[img]/images/updxl-src-windows.gif[/img]</td>\n";
    }
    Add After:
    Code:
    elsif ($vendorid =~ /^Avira$/i)
    {
    print "[img]/images/updxl-src-avira.gif[/img]</td>\n";
    }
    Find:
    Code:
    <td align='center'>[img]/images/updxl-src-symantec.gif[/img]</td>
    <td class='base'>Symantec</td>
    <td class='base'></td>
    Add After:
    Code:
    <td align='center'>[img]/images/updxl-src-avira.gif[/img]</td>
    <td class='base'>Avira Antivirus</td>
    <td class='base'></td>
    
    Next make a 18×18 gif image and call it updxl-src-avira.gif or whichever program it is. Once you have the image place it in /home/httpd/html/images

    That should be it, your custom software updates will now be cached.

    see images:

    [​IMG]

    [​IMG]

    [​IMG]

    :)
     



  2. ^^
    thanks for sharing sir,

    pwede ko pala i-add custom ang AV at Mbam sa aking update accelerator. sa ganitong paraan madali na lang ako mag update ng Avira at Mbam dahil kunin nya na lang sa ipcop box ang updates? how about NOD32 AV sir pa share naman ng code. yun kasi gamit ko eh. heheh

    salamat

    nice guide.
     
  3. Deeza

    Deeza staff Staff Member




    same lang po ang prosesso kung paano gawin. nandiyan na yung guide. at example. at dapat alam mo kung ano ang url ng nod32 updates.
     
  4. josekym

    josekym Member




    Nice tut, Deeza! Thanks!

    Keep up the good work... ;)
     



  5. IP COP MASTER KOYA DEEZA!!!

    [​IMG]
     



  6. Re: Add Custom source to IPCOP Cache (Avira, Malwarebytes) [

    @Deeza Thanks, nice tut

    I've been using ipcop old version in our office for 3years. ngayun ko lang nakita to.
    may addonn na palang ganyan. walapo kc ako update sa mga ipcop.

    thanks.
     
  7. palevelmode

    palevelmode Member




    Nice tut deeza...

    gawa ka pa ng ibang tutorials dito para matuto pa kami :lol:
     



  8. @billy
    alin ng kagaguhan? Wag na UY!
     
  9. Deeza

    Deeza staff Staff Member




    Re: Add Custom source to IPCOP Cache (Avira, Malwarebytes) [

    :) your welcome sir, glad you foud this tut. sir update mo na yan ipcop mo newer ver. 1.4.21
     
  10. Deeza

    Deeza staff Staff Member




    Thanks! sir.
     
  11. Deeza

    Deeza staff Staff Member




    :) ok sir. salamat
     
  12. Deeza

    Deeza staff Staff Member




    ahaha kulitan, hindi po ako ipcop master. anyway nice pic pero :( pakibura po name ko dyan sa picutes. pls po.
     
  13. Deeza

    Deeza staff Staff Member




    OT ka sir.

    wrong post??

    who is billy anyway? :lol:

    alin ang kagaguhan? is he? :)
     
                                 

Share This Page