chiark / gitweb /
check fd watches; other bugfixes
[inn-innduct.git] / samples / startup_innd.pl
1
2 # RCSId:        $Id: startup_innd.pl 6312 2003-05-04 21:40:11Z rra $
3 # Description:  Sample startup code for Perl hooks in INN. This file, after
4 #               it's installed in the right spot, will be loaded when
5 #               innd starts up. The following functions should be defined
6 #               by it (they don't have to be, in fact this file can be
7 #               empty, but it must exist if you've compiled in Perl support).
8 #
9 #               sub filter_before_reload { ... }
10 #                       Called before the filter definition file filter_innd.pl
11 #                       is loaded (every time).
12 #               sub filter_after_reload { ... }
13 #                       Called after the filter definition file filter_innd.pl
14 #                       is loaded (every time).
15 #
16 #               See the sample file filter_innd.pl for details on what it does.
17
18
19 my $before_count = 1 ;
20 # Gets no arguments, and its caller expects no return value.
21 sub filter_before_reload {
22         if ($before_count == 1) {
23 #               Do one thing
24 #               print "First time (before)\n" ;
25                 $before_count++ ;
26         } else {
27 #               Do something else
28 #               print "Time number $before_count (before)\n" ;
29                 $before_count++ ;
30         }
31 }
32
33 my $after_count = 1 ;
34 # Gets no arguments, and its caller expects no return value.
35 sub filter_after_reload {
36         if ($after_count == 1) {
37 #               Do one thing
38 #               print "First time (after)\n" ;
39                 $after_count++ ;
40         } else {
41 #               Do another
42 #               print "Time number $after_count (after)\n" ;
43                 $after_count++ ;
44         }
45 }
46