#!/sbin/openrc-run
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

: ${FILESHELTER_GROUP:=fileshelter}
: ${FILESHELTER_USER:=fileshelter}
: ${FILESHELTER_BINDIR:=/var/lib/fileshelter}

command="/usr/bin/fileshelter"
command_user="${FILESHELTER_USER}:${FILESHELTER_GROUP}"
command_background=true
directory="${FILESHELTER_BINDIR}"
pidfile="/run/${RC_SVCNAME}.pid"
extra_started_commands="reload"

depend() {
	use net
}

reload () {
	ebegin "Reloading configuration and re-opening log files"
	start-stop-daemon --signal HUP --pidfile "${pidfile}"
	eend $?
}
