mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-19 18:26:44 +02:00
- ferm has a test suite, which passes - ferm has multiple (generated) pieces of documentation - it makes sense to use ferm in-place of iptables-save This patch adds tests, packages docs, and adds an openrc init script that I've been using for about a month now. For well-behaved packages (`need firewall`, rather than `need iptables) it can be an in-place replacement (as it `provide firewall`).
40 lines
652 B
Bash
Executable file
40 lines
652 B
Bash
Executable file
#!/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 $?
|
|
}
|