#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

name="NFC daemon"

command="/usr/libexec/nfc/neard"
command_args="${NEARD_OPTS}"

start_stop_daemon_args="--exec /usr/libexec/nfc/neard"

depend() {
	need dbus
}

start_pre() {
	if [ -e /proc/modules ] ; then
		if ! grep -qs NFC_RAW /proc/net/protocols ; then
			modprobe -q nfc
		fi
	fi
}
