#!/sbin/openrc-run

name="${RC_SVCNAME}"
command="/usr/bin/pihole-FTL"
supervisor="supervise-daemon"

command_user="pihole:pihole"
command_args_foreground="no-daemon"
command_background="true"
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
capabilities="^cap_net_raw,^cap_net_admin,^cap_chown,^cap_sys_time,^cap_net_bind_service"
pidfile="/run/pihole/rc-svc-FTL.pid"

depend() {
	need net
	use logger
	after firewall
}

start_pre() {
    checkpath -d -m 0750 -o "$command_user" /run/pihole
}
