#!/sbin/openrc-run

description="unudhcpd"
UNUDHCPD_IF="${RC_SVCNAME#*.}"
command="/usr/bin/unudhcpd"
command_args="-i ${UNUDHCPD_IF:-usb0} -s ${UNUDHCPD_SERVER:-172.16.41.1} -c ${UNUDHCPD_CLIENT:-172.16.42.2}"

depend() {
	need net
}

start_pre() {
	if [ "$UNUDHCPD_IF" = "$RC_SVCNAME" ]; then
		eerror "$RC_SVCNAME cannot be started directly."
		eerror "You need to create symbolic links to it for each interface you want to start it on."
	fi
}
