aboutsummaryrefslogtreecommitdiffstats
path: root/main/ferm/ferm.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/ferm/ferm.initd')
-rwxr-xr-xmain/ferm/ferm.initd40
1 files changed, 40 insertions, 0 deletions
diff --git a/main/ferm/ferm.initd b/main/ferm/ferm.initd
new file mode 100755
index 0000000000..d855f6f79a
--- /dev/null
+++ b/main/ferm/ferm.initd
@@ -0,0 +1,40 @@
+#!/sbin/openrc-run
+
+name="ferm"
+description="For Easy Rule Making is a perl-based iptables frontend"
+description_checkconfig="Checks script validity"
+
+extra_commands="checkconfig"
+
+depend() {
+ after net sysctl
+ provide firewall
+}
+
+checkconfig() {
+ ferm -n "$inputfile"
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ] ; then
+ checkconfig || return $?
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ] ; then
+ checkconfig || return $?
+ fi
+}
+
+start() {
+ ebegin "Loading $inputfile rules"
+ ferm "$inputfile"
+ eend $?
+}
+
+stop() {
+ ebegin "Unloading $inputfile rules"
+ ferm -F "$inputfile"
+ eend $?
+}