view test.bash @ 24:2e23b7184d2b

start coding for bad html tag detection
author carl
date Wed, 19 May 2004 21:40:50 -0700
parents 2ae8d953f1d0
children ccf2c2651c1d
line wrap: on
line source

#!/bin/bash

############################
## compile and run the test program
##
#g++ -c test.cpp
#if [ $? -ne 0 ]; then
#    echo "compiler errors"
#    exit
#fi
#g++ -o test test.o -pthread
#if [ $? -ne 0 ]; then
#    echo "linker errors"
#    exit
#fi


###########################
# compile the milter
#
g++ -c dnsbl.cpp
if [ $? -ne 0 ]; then
    echo "compiler errors"
    exit
fi
g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
if [ $? -ne 0 ]; then
    echo "linker errors"
    exit
fi

if [ "$1" == "comp" ]; then
    exit
fi

# build the test.cf file
make test.cf

# start the milter
pid=/var/run/dnsbl.pid
echo start the milter
mkdir -p /var/run/dnsbl
chmod 700 /var/run/dnsbl
mv -f $pid $pid.save
rm -f /var/run/dnsbl/dnsbl.sock
./dnsbl -d -p local:/var/run/dnsbl/dnsbl.sock
sleep 5
P2=`cat $pid`
mv -f $pid.save $pid
echo started dnsbl milter as process $P2

/usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
sleep 5
P3=`head -1 /var/run/sm-test.pid`
echo started sendmail as process $P3

echo eventually "'"kill -KILL $P2 $P3"'"