#!/bin/sh

# Sample test script for checkpassword-pam

services=`ls /etc/pam.d | tr '\012' ' '`
echo "Available PAM services: $services"
echo
echo -e "Check PAM Service: \c"; read test_service
echo
echo -e "User [$USER]: \c"; read test_user
[ -n "$test_user" ] || test_user=$USER
echo -e "Password: \c"; read -s test_passwd; echo
echo
echo -e "$test_user\0$test_passwd\0timestamp\0" \
	| @PREFIX@/bin/checkpassword-pam -s $test_service \
		--debug --stdout -- /usr/bin/id 3<&0
if [ $? = 0 ]; then
	echo "OK"
else
	echo "FAILED!"
fi
