IMPORTANT: FreeBSD users who install this program from the ports system should read the 'FreeBSD Note' at the end of this document.
******************************** IMPORTANT ********************************
IMPORTANT: This is a "bash" script. It will probably fail if used under another shell. It has been tested on Bash-3.x and 4.x. Its usability under other versions or shells is unknown.
The first time this script is initialized, it will run its basic configuration routine and exit. If you ever want to reconfigure the script, use the [-c] command line option.
If this is an update from an earlier version of this script, it is strongly that this script be run with the [-c] command line option to insure it is configured correctly. In addition, either delete and recreate existing config files or use the "-e ‹name›" option to edit them.
***************************************************************************
REQUIRED FILES:
This script probably has to be run as ROOT or another privileged user who has proper READ/WRITE permissions to the files and directories as well as the Clamav database.
This script has an interactive configuration function. You must run it from the console the first time you invoke it. After that, it will work fine from CRON.
If updating from an older version, you must run the program with the [-c] command line option the first time the program is run. This will create a new config file. The [-c] option will only create a new config file and exit.
EXAMPLE: scamp -C name will create a new scheme named name if it does not exist, or use it if it is present. name is case sensitive. DO NOT use: " \ / { } - [ ] ' , ( ) in the name. Only letters and the underscore are permitted. This can be used effectively when running via CRON. For instance, create a CRON section: scamp.sh -C CRON with logging turned on, random download activated and the summary screen turned off. Place this in your CRON file as: scamp.sh -C CRON. The script will now run silently; however, if an error occurs you will receive an email via CRON. This assumes that the MAILTO: is set in CRON.
The "scamp.sh" file is a BASH script for downloading and installing various Clamav definition files. The script will create a "CONFIGURATION FILE" when first run. The majority of the variables are 'hard coded' into the script. The only one that must be entered is the location of the Clamav database. See your "clamd.conf" file for the correct location.
Examples are:
/usr/local/share/clamav
You must enter the correct location or else the script will not work. The initialization will only occur the first time the script is run, or when there is a major program update that requires it, or when invoked by a command line options [-c].
NOTE: 0 = the number zero, not the letter O
All of these settings with the exception of the CONFIG_FILE location are available through the setup program. Simply pressing <RETURN> will accept the default value shown.
COMMAND LINE OPTION:
When available, lower case letter will turn an option off, while upper case will activate the function. Presently, only the 'log' and 'summary screen' and 'random download timer' functions are supported. They can be set permanently in the config file.
NOTE: "Random Download Timer"
The random download function is only useful when the script is run via CRON. It is ignored at other times. The function can be invoked via the command line using [-R]; i.e., "scamp.sh -R" for instance. You can save the setting permanently in the config file by running the script with the [-c] command line option and then answering the random download question with either 1 or 0. 0 = off & 1 = on.
EXIT CODES:
The following exit code values are available:
INSTALLATION NOTES:
All of the Sanesecurity files and gpg keys are now keep in the Sanesecurity (sane) directory.
For the safest and most error free operation, I would recommend cleaning out the clamav database directory of all files and directories not installed by the 'freshclam' program itself. This appears to be even more important if you have been running another script to update the clamav database.
That would probably include all BUT these files:
stats.dat
Any directories should also be deleted.
Running the script for the first time after cleaning out the clamav database will insure a cleaner install of the new database files. Since it appears that different 'scripts' install a radically different configuration of definition files, this would also insure that only the ones installed by this script are made available to Clamav. It would also insure that outdated files are removed.
DOWNLOADED FILES:
The actual files download and installed by this script include the following.
All of the Sanesecurity files
spear.ndb.sig
Sanesecurity *.ldb files
spam.ldb.sig
Sanesecurity winnow files
winnow_spam_complete.ndb.sig
The Following Securiteinfo files
antispam.ndb
These MSRBL files
MSRBL-SPAM.ndb
The Malware definition file
This script is easily run via CRON. Something like this is all that you probably need. You should probably include a "MAILTO" in the crontab file. Any errors will be mailed to that address. If not all ready set, or if you do not know how to set it, at the command line enter: "whoami" sans quotes and enter that in the mailto variable.
EXAMBLE: Output of 'whoami' was steve. Place this in the top of the cron file:
MAILTO=steve
This would be placed just below the 'SHELL' variable. You can get further information at http://unixhelp.ed.ac.uk/CGI/man-cgi?crontab+5
EULA:
The end user is allowed to make any changes, modifications, or whatever to this script. The author assumes no responsibility for this script, modified or not by the end user. In other words, the user assumes all responsibility for the use of this program. In other words, USE AT YOU OWN RISK.
I can be contacted at: gerard@seibercom.net
The latest version of this script can usually be downloaded from: https://sourceforge.net/projects/scamp/ Older versions may also be available.
Any questions, suggestions, patches, etc. should be directed to me. I really would appreciate it. To make tracking of 'bug' reprts easier, please do the following:
FreeBSD Note:
When installed via the FreeBSD ports system, a configuration file with the basic defaults for Clamav on a FreeBSD system has been installed: "/usr/local/etc/scamp/default". It is still strongly recommended that the first time this script is run, it is run as "scamp.sh -c" to insure the file is configured according to the end users preferences.
Updated: May 19, 2009.