include(confFEATURES_DIR`/cfhead.m4')dnl include(confM4_DIR`/conf.default')dnl include(confSITE_DIR/`conf')dnl changequote(<<, >>) if [ -z "confPERIODIC" ] ; then echo "Error: variable con<<>>fPERIODIC is empty" exit 1 fi if [ ! -d confPERIODIC ] && [ ! -f confPERIODIC ] ; then echo "Error: Directory or file confPERIODIC not found" exit 1 fi link_add() { SRC_DIR=$1 FILE=$2 DST=$3 if [ -x ${SRC_DIR}/${FILE} ] ; then if [ -d ${DST} ] ; then FILE_SRC=`basename ${FILE}` if [ -f /etc/debian_version ] ; then if [ -f ${DST}/${FILE_SRC} ] || [ -h ${DST}/${FILE_SRC} ]; then rm ${DST}/${FILE_SRC}; fi FILE_DST=`basename ${FILE} .sh` else FILE_DST=`basename ${FILE}` fi if [ -f ${DST}/${FILE_DST} ] || [ -h ${DST}/${FILE_DST} ]; then rm ${DST}/${FILE_DST}; fi ln -s ${SRC_DIR}/${FILE_SRC} ${DST}/${FILE_DST} elif [ -f ${DST} ] ; then echo ${SRC_DIR}/${FILE} >> ${DST} fi fi } link_del() { SRC_DIR=$1 FILE=$2 DST=$3 if [ -d ${DST} ] ; then FILE=`basename ${FILE}` if [ -f ${DST}/${FILE} ] || [ -h ${DST}/${FILE} ]; then rm ${DST}/${FILE}; fi if [ -f /etc/debian_version ] ; then FILE=`basename ${FILE} .sh` if [ -f ${DST}/${FILE} ] || [ -h ${DST}/${FILE} ]; then rm ${DST}/${FILE}; fi fi elif [ -f ${DST} ] ; then fname=`basename confPERIODIC` grep -v "${SRC_DIR}/${FILE}" confPERIODIC > /tmp/${fname}.tmp cat /tmp/${fname}.tmp > confPERIODIC fi } link_del_all() { if [ -d confPERIODIC ] ; then if [ ! -z "`ls confPERIODIC/* 2>/dev/null`" ]; then for f in confPERIODIC/* ; do if [ -h $f ]; then if \ [ ! -z "`ls -l $f | grep 'confPERIODIC_DIR'`" ] || \ [ ! -z "`ls -l $f | grep 'confPERIODIC_SITE_DIR'`" ] then rm $f fi fi done fi elif [ -f confPERIODIC ] ; then fname=`basename confPERIODIC` grep -v "confPERIODIC_DIR" confPERIODIC > /tmp/${fname}.tmp cat /tmp/${fname}.tmp > confPERIODIC fi } changequote link_del_all link_add confPERIODIC_DIR delete_old_warnings.sh confPERIODIC define(`USE_QUARANTINE', `NO') ifdef(`confANTIVIRUS1_ACT', `define(`USE_QUARANTINE', `YES')') ifelse_strstr(USE_QUARANTINE`'_AV_QUARANTINE_, `YES', ` link_add confPERIODIC_DIR clear_quarantine.sh confPERIODIC ', ` link_del confPERIODIC_DIR clear_quarantine.sh confPERIODIC ') dnl ifelse(_AV_NO_MBOX_UNSPOOL_, `YES', ` dnl link_add confPERIODIC_DIR clear_scan.sh confPERIODIC dnl ', ` dnl link_del confPERIODIC_DIR clear_scan.sh confPERIODIC dnl ') link_add confPERIODIC_DIR clear_scan.sh confPERIODIC ifelse(confCHECK_OPEN_PROXY, `NO', ` link_del confPERIODIC_DIR proxycheck_del_expired.sh confPERIODIC ', ` link_add confPERIODIC_DIR proxycheck_del_expired.sh confPERIODIC ') ifelse(confGREYLIST, `NO', ` link_del confPERIODIC_DIR greylist_del_expired.sh confPERIODIC ', ` link_add confPERIODIC_DIR greylist_del_expired.sh confPERIODIC ') ifelse(confGREYLIST, `NO', `', ` ifelse_strstr(confGREYLIST_RELAYS, `YES', ` link_add confPERIODIC_DIR greylist_relays_del_expired.sh confPERIODIC ', ` link_del confPERIODIC_DIR greylist_relays_del_expired.sh confPERIODIC ') ') dnl ifelse(confGREYLIST, `NO', `', `') ifelse(confAWL, `NO', ` link_del confPERIODIC_DIR awl_del_expired.sh confPERIODIC ', ` link_add confPERIODIC_DIR awl_del_expired.sh confPERIODIC ') changequote(<<, >>) if [ ! -z "`ls confPERIODIC_SITE_DIR/* 2>/dev/null`" ]; then for f in confPERIODIC_SITE_DIR/* ; do if [ -x $f ] ; then f=`basename $f` link_add confPERIODIC_SITE_DIR $f confPERIODIC fi done fi changequote