aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/openrc/bbfw.firewall.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/openrc/bbfw.firewall.in')
-rw-r--r--src/openrc/bbfw.firewall.in82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/openrc/bbfw.firewall.in b/src/openrc/bbfw.firewall.in
new file mode 100644
index 0000000..dc78f1e
--- /dev/null
+++ b/src/openrc/bbfw.firewall.in
@@ -0,0 +1,82 @@
1#!/sbin/openrc-run
2#
3# Bindle Binaries Linux Firewall
4# Copyright (c) 2021 David M. Syzdek <david@syzdek.net>.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
10# * Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# * Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution.
15# * Neither the name of David M. Syzdek nor the
16# names of its contributors may be used to endorse or promote products
17# derived from this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
23# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29# SUCH DAMAGE.
30#
31# OpenRC init script
32#
33
34description="Bindle Binaries Linux Firewall"
35description_reload="Reload configuration"
36
37extra_commands="sync"
38extra_started_commands="dump log reload"
39
40bbfw_bin="@sbindir@/bbfw"
41bbfw_log_bin="@sbindir@/bbfw-log"
42
43depend() {
44 before net
45 use logger
46 provide firewall
47}
48
49dump() {
50 $bbfw_bin dump
51 return 0
52}
53
54log() {
55 $bbfw_log_bin
56 return 0
57}
58
59reload() {
60 ebegin "Reloading firewall via bbfw"
61 $bbfw_bin restart
62 eend $?
63}
64
65start() {
66 ebegin "Loading firewall via bbfw"
67 $bbfw_bin start
68 eend $?
69}
70
71sync() {
72 ebegin "Syncing firewall rules via bbfw"
73 eend 0
74}
75
76stop() {
77 ebegin "Flushing firewall via bbfw"
78 $bbfw_bin start
79 eend $?
80}
81
82# end of init file