annotate test.bash @ 43:acbe44bbba22

seems to drop root privs ok now
author carl
date Mon, 05 Jul 2004 22:24:22 -0700
parents ccf2c2651c1d
children 510a511ad554
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 #
37
ccf2c2651c1d add -pthread compiler option, fix error in scanning for end of html comment
carl
parents: 16
diff changeset
21 g++ -c -pthread 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
43
acbe44bbba22 seems to drop root privs ok now
carl
parents: 37
diff changeset
43 chmod 750 /var/run/dnsbl
acbe44bbba22 seems to drop root privs ok now
carl
parents: 37
diff changeset
44 chown dnsbl:dnsbl /var/run/dnsbl
0
96a9758165cd Initial revision
carl
parents:
diff changeset
45 mv -f $pid $pid.save
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