30 lines
680 B
Plaintext
Executable File
30 lines
680 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
command=/usr/bin/crowdsec-firewall-bouncer
|
|
command_args="-c /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml"
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
command_background=true
|
|
extra_started_commands="reload"
|
|
description_reload="Reload configuration"
|
|
|
|
depend() {
|
|
need net
|
|
after firewall crowdsec
|
|
use logger
|
|
}
|
|
|
|
start_pre() {
|
|
ebegin "Validating CrowdSec firewall bouncer config"
|
|
${command} -c /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml -t || return 1
|
|
eend $?
|
|
|
|
# Wait for Crowdsec to start(in case of boot)
|
|
sleep 2
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading $RC_SVCNAME"
|
|
start-stop-daemon --signal HUP --pidfile "$pidfile"
|
|
eend $?
|
|
}
|