I am not sure if this is even possible; however, I thought I would ask anyway.
Using "wget 1.10.2" on a FreeBSD-6.2 system. I am working on a script that downloads AV signature files, unzips them if necessary and then tests and installs them. Presently, I am using the "-N" flag so as to only download newer files. The files would be downloaded to a temporary location, tested and then installed. Many of these files have to be uncompressed with 'gunzip' prior to testing and installation. Assuming a base name of AV.hdb.gz for a file I am downloading. The file is decompressed to AV.hdb, tested and installed in another directory. Is it possible for wget to compare the file named "AV.hdb' located in one directory, and if it is older than the AV.hdb.gz file located on the remote server, to download the "AV.hdb.gz" file to the temporary directory? I cannot seem to find a way to do it. The only option I have come up with is to keep a copy of the "gz" file in the temporary directory and run wget from there. Unfortunately, at least as far as I can tell, wget does not issue an exit code if it has downloaded a newer file. Therefore, I am unable to craft a script that will unpack the file, test and install it if a newer version has been downloaded. At least not easily anyway. I was thinking of having wget check the file in the tmp directory and then, if a newer version were present, download the newer version to a sub-tmp directory; however, that has also ran into problems. Using something like 'wget http://somelocation.com/av.file.gz' > /root/av-files/tmp/test' results in an error message. I really appreciate any help that is available. It would really be nice though if wget simply issued an exit code if an updated file were downloaded. That would simplify everything. -- Gerard