Created on behalf of @mgziminsky - see this issue comment: https://github.com/pi-hole/pi-hole/issues/6454#issuecomment-3476576177 Signed-off-by: Sparronator9999 <86388887+Sparronator9999@users.noreply.github.com>
41 lines
835 B
Plaintext
41 lines
835 B
Plaintext
#!/sbin/openrc-run
|
|
# shellcheck shell=sh disable=SC2034
|
|
|
|
: "${PI_HOLE_SCRIPT_DIR:=/opt/pihole}"
|
|
|
|
command="/usr/bin/pihole-FTL"
|
|
command_user="pihole:pihole"
|
|
supervisor=supervise-daemon
|
|
command_args_foreground="-f"
|
|
command_background=true
|
|
pidfile="/run/${RC_SVCNAME}_openrc.pid"
|
|
extra_started_commands="reload"
|
|
|
|
respawn_max=5
|
|
respawn_period=60
|
|
capabilities="^CAP_NET_BIND_SERVICE,^CAP_NET_RAW,^CAP_NET_ADMIN,^CAP_SYS_NICE,^CAP_IPC_LOCK,^CAP_CHOWN,^CAP_SYS_TIME"
|
|
|
|
depend() {
|
|
want net
|
|
provide dns
|
|
}
|
|
|
|
checkconfig() {
|
|
$command -f test
|
|
}
|
|
|
|
start_pre() {
|
|
sh "${PI_HOLE_SCRIPT_DIR}/pihole-FTL-prestart.sh"
|
|
}
|
|
|
|
stop_post() {
|
|
sh "${PI_HOLE_SCRIPT_DIR}/pihole-FTL-poststop.sh"
|
|
}
|
|
|
|
reload() {
|
|
checkconfig || return $?
|
|
ebegin "Reloading ${RC_SVCNAME}"
|
|
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
|
eend $?
|
|
}
|