Nav's Place: Nav's Home on the Interwebs

Add Custom source to IPCOP Cache

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:
# -----------------------------------------------------------
# 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 ..
# -----------------------------------------------------------
# Section: Avast Downloads
# -----------------------------------------------------------if ($source_url =~ m@^http://download[\d]+\.avast\.com/.*\.(exe|vpu)$@i)
{
$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@^http://download[\d]+\.avast\.com/.*\.(exe|vpu)$@i to look something like $source_url =~ m@^http://dl[0-9]\.avgate\.net/.*\.(exe|dll|vdf|dat|gz)$@i 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):

# -----------------------------------------------------------
# Section: Avast Downloads
# -----------------------------------------------------------if ($source_url =~ m@^http://download[\d]+\.avast\.com/.*\.(exe|vpu)$@i)
{
$xlrator_url = &check_cache($source_url,$hostaddr,$username,"Avast",$mirror);
}# -----------------------------------------------------------
# -----------------------------------------------------------
# Section: Avira Downloads
# -----------------------------------------------------------

if ($source_url =~ m@^http://dl[0-9]\.avgate\.net/.*\.(exe|dll|vdf|dat|gz)$@i)

{
$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:
elsif ($vendorid =~ /^Microsoft$/i)
{
print "<img src='/images/updxl-src-windows.gif' alt='Microsoft'}' />&nbsp;</td>\n";
}

After Add:
elsif ($vendorid =~ /^Avira$/i)
{
print "<img src='/images/updxl-src-avira.gif' alt='Avira'}' />&nbsp;</td>\n";
}

Final Result:
elsif ($vendorid =~ /^Microsoft$/i)
{
print "<img src='/images/updxl-src-windows.gif' alt='Microsoft'}' />&nbsp;</td>\n";
}elsif ($vendorid =~ /^Avira$/i)
{
print "<img src='/images/updxl-src-avira.gif' alt='Avira'}' />&nbsp;</td>\n";
}

Next Find:
elsif ($vendorid =~ /^Microsoft$/i)
{
print "<img src='/images/updxl-src-windows.gif' alt='Microsoft'}' />&nbsp;</nobr></td>\n";
print "<td class='base'>&nbsp;Microsoft&nbsp;</td>\n";
}

After Add:
elsif ($vendorid =~ /^Avira$/i)
{
print "<img src='/images/updxl-src-avira.gif' alt='Avira'}' />&nbsp;</nobr></td>\n";
print "<td class='base'>&nbsp;Avira Antivirus&nbsp;</td>\n";
}

Find:
elsif ($vendorid =~ /^Microsoft$/i)
{
print "<img src='/images/updxl-src-windows.gif' alt='Microsoft'}' />&nbsp;</td>\n";
}

Add After:
elsif ($vendorid =~ /^Avira$/i)
{
print "<img src='/images/updxl-src-avira.gif' alt='Avira'}' />&nbsp;</td>\n";
}

Find:
<td align='center'><img src='/images/updxl-src-symantec.gif' alt='Symantec' /></td>
<td class='base'>Symantec</td>
<td class='base'>&nbsp;</td>

Add After:
<td align='center'><img src='/images/updxl-src-avira.gif' alt='Avira' /></td>
<td class='base'>Avira Antivirus</td>
<td class='base'>&nbsp;</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.

You can follow any responses to this entry through the RSS 2.0 feed.