server: truncate slurp'd files correctly
[rb-79.git] / rb79-ban-ip.1
blobe7e6ef8ff8fc06543f5f966ba70ff83c007e0d71
1 .Dd 2017-05-23
2 .Dt RB79-BAN-IP 1
3 .Os
4 .Sh NAME
5 .Nm rb79-ban-ip
6 .Nd ban an IP address 
7 .Pq or range
8 from posting temporarily
9 .Sh SYNOPSIS
10 .Nm
11 .Oo
12 .Fl i
13 .Ar individual-ip
14 .Oc
15 .Oo
16 .Fl f
17 .Ar first-ip
18 .Fl l
19 .Ar last-ip
20 .Oc
21 .Oo
22 .Fl m
23 .Ar ban-message
24 .Oc
25 .Oo
26 .Fl b
27 .Ar board-name
28 .Oc
29 .Oo
30 .Fl u
31 .Ar banned-until
32 .Oc
33 .Sh DESCRIPTION
34 .Nm
35 Inserts a ban into the global
36 .Pq or board-specific 
37 database which will affect either
38 .Ar individual-ip
39 or all IP addresses between
40 .Pq inclusive
41 .Ar first-ip
42 and
43 .Ar last-ip .
44 .Sh OPTIONS
45 .Bl -tag -width Ds
46 .It Fl i
47 The IP address to ban, either in IPV4 or IPV6 format. This option is mutually exclusive with the
48 .Fl f ,
49 .Fl l
50 pair.
51 .It Fl f
52 The start of an IP address range to ban
53 .Pq inclusive ,
54 mutually exclusive with
55 .Fl i .
56 This option requires a matching
57 .Fl l .
58 .It Fl l
59 The end of an IP address range to ban
60 .Pq inclusive ,
61 mutually exclusive with
62 .Fl i .
63 This option requires a matching
64 .Fl f .
65 .It Fl m
66 The ban message to display. This may include HTML, as it dropped directly
67 .Pq without escaping
68 into a HTML page. If not specified, the ban message will be empty.
69 .It Fl u
70 The time, as a UTC timestamp, when the ban should expire. If not specified,
71 .Ar banned-until
72 defaults to the current timestamp, plus 604800 seconds
73 .Pq seven days .
74 .El
75 .Sh EXAMPLES
76 .Pp
77 .Dl % rb79-ban-ip -b m -f 100.0.0.0 -l 200.0.0.0 \e\ 
78 .Dl \& \& \& \& \& \& \& \& \& \& \& \& \& \& -u $(($(date +%s) + 600)) \e\ 
79 .Dl \& \& \& \& \& \& \& \& \& \& \& \& \& \& -m \*qcalm down\*q
80 .Pp
81 .Dl % rb79-ban-ip -i 127.0.0.1 -m 'You are the worst poster here.'
82 .Pp
83 .Dl % rb79-ban-ip -i 127.0.0.2 -u 9999999999999999 \e\ 
84 .Dl \& \& \& \& \& \& \& \& \& \& \& \& \& \& -m '<img src=\*q/misc/go-away.png\*q>'
85 .Pp
86 .Sh SEE ALSO
87 .Xr rb79 1
88 .Sh AUTHORS
89 .An De Rais Aq Mt derais@cock.li