Script to create an update mirror for Eset Nod32 on Linux

    If you are engaged in administration, it is very likely that sooner or later the question will arise - “Nod32 antivirus is installed on client computers, it would be necessary to create a single mirror of updates for them”. And here there are several possible ways to develop the plot:

    1. "Server on Windows, enough money." Everything is quite simple here - we buy a license, put the desired Nod32 distribution on the server, configure, rejoice. The option is more mythical, as it is extremely rare when there is “enough money” for IT.
    2. "Server on Windows, money is not enough." There are options. Starting from the use of license licenses, to manual scripting and the use of Linux-solutions ( cygwin to help).
    3. "Server on Linux." Money in this case simply does not have much significance. We have hands, we have a head, and we have a desire to do everything quite qualitatively and reliably.

    We’ll talk about the third option now.


    What is being reworked for work?

    • Unix- system (tested on CentOS 7, FreeNas 9.3 and FreeBSD 8.3);
    • Bash (tested on versions 4.1.11 (2), 4.2.24 (1) and 4.2.45 (1));
    • Installed curl , wget , unrar (optional), and some other standard applications.


    Installation

    • Download the latest version and unpack it:
      $ cd /tmp
      $ wget https://github.com/tarampampam/nod32-update-mirror/archive/master.zip
      $ unzip master.zip; cd ./nod32-update-mirror-master/

    • We transfer the set of scripts to a directory that is inaccessible from the outside, but accessible to the user who will run it:
      $ mv -f ./nod32upd/ /home/

    • Go to the new location of the scripts and configure them (more about this in readme.md ):
      $ cd /home/nod32upd/
      $ nano ./settings.cfg

    • We give the right to run scripts:
      $ chmod +x ./*.sh

    • Check for unrar if we plan to upgrade from official Eset NOD32 mirrors:
      $ type -P unrar

    • We carry out a trial run:
      $ ./update.sh


    After all these manipulations, they should observe something similar to:


    Features

    • It is completed with a script for automatically obtaining a working key from pirated resources. ATTENTION! THIS FUNCTIONAL IS ONLY FOR ACQUAINTANCE AND STUDY ! YOU ARE RESPONSIBLE FOR ITS USE! USE ONLY THE LEGAL AND YOUR KEYS BOUGHT BY YOU!
    • If an error occurred while updating from the server that is specified, for example, in updServer0- an attempt is made to upgrade from the server specified in updServer1, updServer2.. updServer10;
    • Download only updated update files (verification is performed using wget --timestamping);
    • It works only with the necessary types of updates, the desired language and updates only for the necessary software (without this, the size of the update database is a little more than 5.2 GB, with the types indicated - 0.6 GB);
    • It is able to keep up to date only the update.ver file without downloading the update files themselves (while the mirror works, but the download is not from your server, but from the source server of the updates);
    • The kit includes a blank for the web interface of the update mirror (directory ./webface).


    MIT License
    Copyright © 2014

    This license allows individuals who have received a copy of this software and related documentation (hereinafter referred to as the “Software”) to use the Software free of charge without restrictions, including unlimited right to use, copy, modify, add, publish, distribute, sublicense and / or sale of copies of the Software, as well as to persons who are provided with this Software, subject to the following conditions:

    The above Copyright notice and these terms and conditions must be included in all copies or significant parts of this Software.

    THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTY OF SHEET SHIPPING SHEET. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR CLAIMS FOR DAMAGES, LOSSES, OR OTHER REQUIREMENTS UNDER APPLICABLE CONTRACT, TORT OR OTHERWISE, ARISING FROM HAVING THE RESULT OF OR RELATED TO THE SOFTWARE OR THE USE OF THE SOFTWARE OR OTHER DEALINGS IN THE SOFTWARE.

    Bonus '' Distribution with built-in settings ''
    Everything is very simple here. We put 3 files in one folder:


    In config.small.xml we specify the necessary settings:

    Where %% url_updates_server %% - in both cases are identical and equal to the address of our update server. The easiest way to get the config is “ESET NOD32 Antivirus” Window → “Settings” → “Import and Export Settings”. From the received xml-file we delete everything except the necessary settings (since all sections are very well-named).

    The following is the install.cmd installation script :
    @echo off
    title "Run ESET Nod32 Installer"
    cls
    set AppToRun=ESET_NOD32_Antivirus_4.2.71.3_(32-bit)_(rus).msi
    set  CfgFile=config.small.xml
    rem /qb - показывается процесс установки
    rem /qn - тихий режим установки без gui
    start "" "msiexec" /qb /package "%cd%\%AppPath%%AppToRun%" ADMINCFG="%cd%\%CfgPath%%CfgFile%"
    @echo on


    And all this business with the help of the brainchild of Yevgeny Roshal is packed in the SFX archive with the parameters:
    Path=%TEMP%\Nod32Install\
    Setup=%TEMP%\Nod32Install\install.cmd
    Silent=1
    Overwrite=1


    Thus, when you double-click on the resulting binary, quiet unpacking occurs in% TEMP% \ Nod32Install \, install.cmd is launched, which starts the installation of ESET_NOD32_Antivirus_4 . 2.71.3_ (32-bit) _ (rus) .msi with the settings from config.small.xml without asking the user for anything, but showing the installation process. For inexperienced users - that’s it.




    If you have any questions, but you can’t leave comments on this post or write me in a personal - write comments on this post .



    Update: The post was rewritten 02/09/2015, because its previous edition lost relevance to a greater extent

    Update: 07/09/2016 the script was rewritten a little less than completely. If you used the old version earlier, I highly recommend updating. The sources are there, as always - on the gita

    Also popular now: