annotate test.bash @ 16:2ae8d953f1d0

add scanning for bare hostnames
author carl
date Thu, 29 Apr 2004 21:56:22 -0700
parents 443aa0e8c6fa
children ccf2c2651c1d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a9758165cd Initial revision
carl
parents:
diff changeset
1 #!/bin/bash
96a9758165cd Initial revision
carl
parents:
diff changeset
2
14
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
3 ############################
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
4 ## compile and run the test program
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
5 ##
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
6 #g++ -c test.cpp
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
7 #if [ $? -ne 0 ]; then
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
8 # echo "compiler errors"
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
9 # exit
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
10 #fi
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
11 #g++ -o test test.o -pthread
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
12 #if [ $? -ne 0 ]; then
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
13 # echo "linker errors"
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
14 # exit
443aa0e8c6fa changes suggested by Nigel Horne
carl
parents: 13
diff changeset
15 #fi
13
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
16
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
17
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
18 ###########################
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
19 # compile the milter
2752e512fd32 finish documentation
carl
parents: 9
diff changeset
20 #
0
96a9758165cd Initial revision
carl
parents:
diff changeset
21 g++ -c dnsbl.cpp
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
22 if [ $? -ne 0 ]; then
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
23 echo "compiler errors"
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
24 exit
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
25 fi
0
96a9758165cd Initial revision
carl
parents:
diff changeset
26 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
27 if [ $? -ne 0 ]; then
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
28 echo "linker errors"
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
29 exit
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
30 fi
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
31
0
96a9758165cd Initial revision
carl
parents:
diff changeset
32 if [ "$1" == "comp" ]; then
96a9758165cd Initial revision
carl
parents:
diff changeset
33 exit
96a9758165cd Initial revision
carl
parents:
diff changeset
34 fi
96a9758165cd Initial revision
carl
parents:
diff changeset
35
96a9758165cd Initial revision
carl
parents:
diff changeset
36 # build the test.cf file
96a9758165cd Initial revision
carl
parents:
diff changeset
37 make test.cf
96a9758165cd Initial revision
carl
parents:
diff changeset
38
96a9758165cd Initial revision
carl
parents:
diff changeset
39 # start the milter
96a9758165cd Initial revision
carl
parents:
diff changeset
40 pid=/var/run/dnsbl.pid
96a9758165cd Initial revision
carl
parents:
diff changeset
41 echo start the milter
96a9758165cd Initial revision
carl
parents:
diff changeset
42 mkdir -p /var/run/dnsbl
96a9758165cd Initial revision
carl
parents:
diff changeset
43 chmod 700 /var/run/dnsbl
96a9758165cd Initial revision
carl
parents:
diff changeset
44 mv -f $pid $pid.save
96a9758165cd Initial revision
carl
parents:
diff changeset
45 rm -f /var/run/dnsbl/dnsbl.sock
16
2ae8d953f1d0 add scanning for bare hostnames
carl
parents: 14
diff changeset
46 ./dnsbl -d -p local:/var/run/dnsbl/dnsbl.sock
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
47 sleep 5
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
48 P2=`cat $pid`
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
49 mv -f $pid.save $pid
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
50 echo started dnsbl milter as process $P2
0
96a9758165cd Initial revision
carl
parents:
diff changeset
51
8
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
52 /usr/lib/sendmail -bd -Ctest.cf -Ldnsbl
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
53 sleep 5
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
54 P3=`head -1 /var/run/sm-test.pid`
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
55 echo started sendmail as process $P3
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
56
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
57 echo eventually "'"kill -KILL $P2 $P3"'"
dbe18921f741 integration work on url scanner
carl
parents: 5
diff changeset
58