#!/sbin/openrc-run
supervisor="supervise-daemon"

# fallback values for /etc/conf.d/ddnrs
: ${command_user:=ddnrs:ddnrs}
: ${logdir:=/var/log/ddnrs}

name=ddnrs
description="Automatically update dns records to match your current IP"
command="/usr/bin/ddnrs run"
command_background=true

pidfile="/run/$name.pid"
output_log="$logdir/output.log"
error_log="$logdir/error.log"

depend() {
	need net
	use logger
}

start_pre() {
	checkpath -d -o "$command_user" "$logdir" # "$directory"
	checkpath -f -o "$command_user" "$output_log" "$error_log"
}
