#!/bin/sh

dev="$1"
shift
args=""

for igniter in "$@"; do
    case "$igniter" in
	-*)
	    args="$args $igniter"
	    ;;
	*)
	    pass="n"
	    while [ $pass != "y" ]; do
		echo -n "Testing $igniter igniter. Press enter to continue..."
		read foo < /dev/tty
		../ao-tools/ao-test-igniter/ao-test-igniter --tty="$dev" $args $igniter

		case $? in
		    0)
			echo "pass"
			pass="y"
			;;
		    *)
			echo "Failed. Try again."
			;;
		esac
	    done
	    ;;
    esac
done

exit 0
