diff --git a/sa-update.cronscript b/sa-update.cronscript index 187b9a0..e327259 100644 --- a/sa-update.cronscript +++ b/sa-update.cronscript @@ -26,7 +26,8 @@ fi CHANNELLIST="" KEYLIST="" # Process each channel defined in /etc/mail/spamassassin/channel.d/ -for file in $(find -L /etc/mail/spamassassin/channel.d/ -mindepth 1 -maxdepth 1 -type f -name '*.conf'); do +for file in /etc/mail/spamassassin/channel.d/*.conf; do + [ ! -f "$file" ] && continue # Validate config file PREFIXES="CHANNELURL KEYID BEGIN" for prefix in $PREFIXES; do @@ -35,12 +36,12 @@ for file in $(find -L /etc/mail/spamassassin/channel.d/ -mindepth 1 -maxdepth 1 exit 255 fi done - . $file - #echo "CHANNELURL=$CHANNELURL" - #echo "KEYID=$KEYID" + . "$file" + echo "CHANNELURL=$CHANNELURL" + echo "KEYID=$KEYID" CHANNELLIST="$CHANNELLIST $CHANNELURL" KEYLIST="$KEYLIST $KEYID" - sa-update --import $file + sa-update --import "$file" done # Sleep random amount of time before proceeding to avoid overwhelming the servers