Sn!iper <quite a nick!>:

2008/3/25, Matt Kettler <[EMAIL PROTECTED]>:
> Sn!per wrote:
>  >
>  >> You should be able to just do something like this:
>  >>
>  >> 27 * * * *  /usr/bin/sa-update && /etc/init.d/spamd restart
>  >>
>  >
>  > Will that also update sought and openprotect when new rules are made 
> available?
>
>
> Apparently it won't... my bad.. For some reason I was thinking sa-update
>  would by default grab all the channels it had been "introduced to".. but
>  by default it only grabs the official channel.. Not sure why my brain
>  wasn't working right there...

I use something like this:

#!/bin/sh
#
# update spamassassin
#
sa-update --gpgkey D1C035168C1EBC08464946DA258CDB3ABDE9DC10 --channel
saupdates.openprotect.com
exitcodeA=$?
sa-update --gpgkey 26C900A46DD40CD5AD24F6D7DEE01987265FA05B --channel
updates.spamassassin.org
exitcodeB=$?
sa-update --gpgkey 6C6191E3 --channel sought.rules.yerp.org
exitcodeC=$?
if [ $exitcodeA -eq 0 -o $exitcodeB -eq 0 -o $exitcodeC -eq 0 ]
 then
  echo "Spamassassin rules updated."
  sa-compile
  spamassassin --lint
  /etc/init.d/amavis restart
   exitcode2=$?
  if [ $exitcode2 -eq 0 ]
    then
       echo "Lint passed without error."
  fi
 exit
fi
if [ $exitcodeA -eq 1 -o $exitcodeB -eq 1 -o $exitcodeC -eq 1 ]
 then
  echo "Spamassassin update run - no new rules today."
  exit
fi

if [ $exitcodeA -ge 4 -o $exitcodeB -ge 4 -o $exitcodeC -ge 4 ]
 then
  echo "Spamassassin update exited with error code of $exitcode"
  exit
fi
#--eof--

The syntax could be improved, for sure, but it delivers my main goal,
which is updating the channels ;-)

>
>  However, I do still recommend using some random oddball number instead
>  of 00 for the minute.
>


Luis
-- 
_____________________________________

GNU/GPL: "May The Source Be With You...

        Linux Registered User #448382.
_____________________________________

Reply via email to