#!/bin/bash 
#
# by Matthew Grant <grantma@anathoth.gen.nz>, (c) 2004
# licensed for use under GPL version 2
#
# Tests whether hotplug is set up and running or not.

# Turn on debugging
[ "$DEBUGWHEREAMI" = "1" ] && set -o xtrace

case $1 in
	*,*)
		FILE=${1/,*}
		STRING=${1/*,}
		;;
	*)
		[ "$DEBUGWHEREAMI" != "" ] \
	&& echo "$0: failing miserably - args not understood"
		exit 255
		;;
esac

[ -f "$FILE" ] \
	&& cat "$FILE" | grep -E -q "$STRING" \
	&& exit 0

exit 1
