alpine-repos/minoplhy-crowdsec-firewall-bouncer/crowdsec-firewall-bouncer.initd

30 lines
680 B
Plaintext
Raw Normal View History

2025-05-01 23:03:50 +07:00
#!/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
2025-05-01 23:03:50 +07:00
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
}
2025-05-01 23:03:50 +07:00
reload() {
ebegin "Reloading $RC_SVCNAME"
start-stop-daemon --signal HUP --pidfile "$pidfile"
eend $?
}