#!/sbin/openrc-run

# Initscript by Diaz Devera Victor <vitronic2@gmail.com>
# Copyright 2014 Alpine Linux
# Distributed under the terms of the GNU General Public License v2

name="$SVCNAME"
pidfile="/run/$SVCNAME.pid"
command="/usr/sbin/$SVCNAME"
command_args="$CRON_OPTS"

extra_started_commands="reload"
description_reload="Force fcron to reload its configuration"

depend() {
	need localmount
	need logger
}

reload() {
	ebegin "Reloading $name configuration"
	if [ "$supervisor" ]; then
		$supervisor "$RC_SVCNAME" --signal USR1
	else
		start-stop-daemon --signal USR1 --pidfile "$pidfile"
	fi
	eend $?
}
