add firehol-3.1.0

This commit is contained in:
Florian Tham
2017-01-01 12:22:58 +01:00
parent 89b36ca445
commit 0c961e8c73
7 changed files with 194 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
diff -urNp firehol-2.0.1/sbin/firehol.in firehol-2.0.1.new/sbin/firehol.in
--- firehol-2.0.1/sbin/firehol.in 2015-02-15 17:08:03.000000000 +0200
+++ firehol-2.0.1.new/sbin/firehol.in 2015-04-14 18:05:22.262234003 +0300
@@ -846,12 +846,12 @@ test -z "$FIREHOL_ROUTING" && \
# Where /etc/init.d/iptables expects its configuration?
# Leave it empty for automatic detection
test -z "$FIREHOL_AUTOSAVE" && \
- FIREHOL_AUTOSAVE=
+ FIREHOL_AUTOSAVE="@FIREHOL_AUTOSAVE@"
# Where /etc/init.d/ip6tables expects its configuration?
# Leave it empty for automatic detection
test -z "$FIREHOL_AUTOSAVE6" && \
- FIREHOL_AUTOSAVE6=
+ FIREHOL_AUTOSAVE6="@FIREHOL_AUTOSAVE6@"
# Set to non-empty to wait (max 60 seconds) for a network interface
test -z "$WAIT_FOR_IFACE" && \

View File

@@ -0,0 +1,2 @@
#Locate of FireHOL conf file
FIREHOL_CONF="/etc/firehol/firehol.conf"

View File

@@ -0,0 +1,67 @@
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
extra_commands="save panic try"
extra_started_commands="reload"
depend() {
need localmount
after bootmisc
before net
provide firewall
}
checkrules() {
if [ ! -f ${FIREHOL_CONF} ]; then
eerror "Not starting FireHOL. Create ${FIREHOL_CONF}"
eerror "and fill it with some rules."
eerror "man firehol.conf for more info."
return 1
fi
}
start() {
checkrules || return 1
ebegin "Starting FireHOL"
/usr/sbin/firehol ${FIREHOL_CONF} start > /dev/null
eend $?
}
stop() {
ebegin "Stopping FireHOL"
/usr/sbin/firehol stop > /dev/null
eend $?
}
restart() {
ebegin "Restarting Firewall"
svc_stop;
svc_start;
eend $?
}
try() {
ebegin "Trying FireHOL configuration"
/usr/sbin/firehol ${FIREHOL_CONF} try
eend $?
}
status() {
ebegin "Showing FireHOL status"
/usr/sbin/firehol status
eend $?
}
panic() {
ebegin "FireHOL PANIC"
/usr/sbin/firehol panic
eend $?
}
save() {
ebegin "Saving FireHOL configuration"
/usr/sbin/firehol save
eend $?
}

View File

@@ -0,0 +1,2 @@
#Locate of FireQOS conf file
FIREQOS="/etc/firehol/fireqos.conf"

View File

@@ -0,0 +1,45 @@
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
depend() {
need localmount
after bootmisc
before net
}
checkrules() {
if [ ! -f ${FIREQOS_CONF} ]; then
eerror "Not starting FireQOS. Create ${FIREQOS_CONF}"
eerror "and fill it with some rules."
eerror "man fireqos.conf for more info."
return 1
fi
}
start() {
checkrules || return 1
ebegin "Starting FireQOS"
/usr/sbin/fireqos start ${FIREQOS_CONF} -- ${FIREQOS_EXTRA_ARGS} > /dev/null
eend $?
}
stop() {
ebegin "Stopping FireQOS"
/usr/sbin/fireqos stop > /dev/null
eend $?
}
restart() {
ebegin "Restarting FireQOS"
svc_stop;
svc_start;
eend $?
}
status() {
ebegin "Showing FireQOS status"
/usr/sbin/fireqos status
eend $?
}