#!/lib/klibc/bin/sh
# $Id: udev.get_input_lirc.sh 87 2004-07-29 13:16:55Z olh $
#
# Gerd Knorr <kraxel@suse.de>
# figure the name for a given ($1) input event device
#
# hopefully the input layer exports this via sysfs some day,
# so this hack can go away ...
#
PATH="/lib/klibc/bin"
NAME=""
while read line; do
	case "$line" in
		"N: "*)
			NAME="${line#N: Name=\"}"
			NAME="${NAME%\"}"
		;;
		"H: "*"$1"*)
			echo $NAME;
		;;
	esac
done < /proc/bus/input/devices

