At 02:50 PM 2.4.2004 -0700, Andrew Ott wrote:
> Check out the Rules Du Jour Script to auto download custom rule sets.
>
>http://www.exit0.us/index.php/RulesDuJour 
>
> 
>-----Original Message-----
>From: Evan Platt [mailto:[EMAIL PROTECTED] 
>Sent: Wednesday, February 04, 2004 1:11 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Auto-download of *.cf files
>
>-----Original Message-----
>From: "Carl Chipman" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Date: Wed, 4 Feb 2004 13:54:33 -0600
>Subject: Auto-download of *.cf files
>
>> I remember some people talking about using a perl script to download 
>> new cf files daily.
>> 
>> Does anyone have a vb or javascript version of it?  I'm loath to 
>> install perl on my mailserver if there's already another version.
>
>Ditto on that - "Add me to your list". Or actually... I missed that thread.
>I have Perl, so if someone has that script (I missed that thread), please
>let me know!
>
>Thanks.
>

Here's another than runs under Bourne shell (sh), a portion of which I got
from an earlier post. The interactive part after the LINTing could be
modified to use with cron because it will abort if not given a 'yes' within
30 secs. A lot less code......

START-----------------------------------------------------------
#!/bin/sh
MOVE="bigevil.cf 99_FVGT_Tripwire.cf backhair.cf chickenpox.cf weeds_2.cf
evilnumbers.cf antidrug.cf"

# List of files to grab
    files="
            http://www.merchantsoverseas.com/wwwroot/gorilla/bigevil.cf

http://www.merchantsoverseas.com/wwwroot/gorilla/99_FVGT_Tripwire.cf
            http://www.emtinc.net/includes/backhair.cf
            http://www.emtinc.net/includes/chickenpox.cf
            http://www.emtinc.net/includes/weeds_2.cf
            http://www.yackley.org/sa-rules/evilnumbers.cf
            http://mywebpages.comcast.net/mkettler/sa/antidrug.cf
          "
# Save backup of current set of rules
    /bin/cp -fv ${MOVE} /usr/local/etc/mail/save

# change to the spamassassin config directory
            cd /usr/local/etc/mail/spamassassin

# Grab all of the requested files
    restart=0
    for file in $files; do
        if [ "$file" != "" ]; then
            wget -Nv "$file" 2>&1 | grep saved
        # Do we want SA to restart?
            if [ $? = 0 ]; then
                restart=1
            fi
        fi
    done

# Restart spamassassin
    if [ $restart = 1 ] ; then
        cd /usr/local/etc/mail/spamassassin
        /usr/local/bin/spamassassin --lint
        get_yes_no() {
                while true
                do
                        echo -n "$1 (Y/N) ? " 
                        read -t 30 a
                        if [ $? != 0 ]; then
                                a="No";
                                return;
                        fi
                        case $a in
                                [Yy]) a="Yes";
                                return;;
                                [Nn]) a="No";
                                return;;
                                *);;
                        esac
                done
        }

        get_yes_no "Do you want to continue......"

        [ $a = 'No' ] && exit 1

echo ".....starting NOW!............"
        /usr/local/bin/spamass
        echo "Restarted SpamAssassin"
    fi
END-----------------------------------------------------------

Best regards,
Jack L. Stone,
Administrator

Sage American
http://www.sage-american.com
[EMAIL PROTECTED]

Reply via email to