From: <jgs...@us...> - 2004-03-01 16:36:14
|
Update of /cvsroot/serverfilters/script In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4201 Modified Files: test.sh Log Message: Made test.sh more user friendly. Index: test.sh =================================================================== RCS file: /cvsroot/serverfilters/script/test.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test.sh 29 Feb 2004 22:55:55 -0000 1.5 --- test.sh 1 Mar 2004 16:17:07 -0000 1.6 *************** *** 3,8 **** # need a valid username/password for testing if [ ! -s test_creds ]; then ! echo Enter a valid IMAP username and password on separate lines: ! head -2 > test_creds fi --- 3,10 ---- # need a valid username/password for testing if [ ! -s test_creds ]; then ! read -p "IMAP username: " USER ! read -p "IMAP password: " PASS ! echo $USER > test_creds ! echo $PASS >> test_creds fi *************** *** 14,21 **** cd $RUNFROM ! cat $SCRIPTDIR/test_creds | $SCRIPTDIR/filtercmd getrc filter > $SCRIPTDIR/filter; echo "RESULT:" $? echo '# filtercmd testing ' >> $SCRIPTDIR/filter ! cat $SCRIPTDIR/test_creds | $SCRIPTDIR/filtercmd putrc filter; echo "RESULT:" $? ! cat $SCRIPTDIR/test_creds | $SCRIPTDIR/filtercmd getrc filter; echo "RESULT:" $? echo If you do not need to perform additional tests, remove the file 'test_creds' --- 16,48 ---- cd $RUNFROM ! cat $SCRIPTDIR/test_creds | $SCRIPTDIR/filtercmd getrc filter > $SCRIPTDIR/filter; ! if [ $? == '0' ] ; then ! echo "Pass" ! else ! echo "RESULT:" $? ! fi; echo '# filtercmd testing ' >> $SCRIPTDIR/filter ! cat $SCRIPTDIR/test_creds | $SCRIPTDIR/filtercmd putrc filter; ! if [ $? == '0' ] ; then ! echo "Pass" ! else ! echo "RESULT:" $? ! fi; ! cat $SCRIPTDIR/test_creds | $SCRIPTDIR/filtercmd getrc filter; ! if [ $? == '0' ] ; then ! echo "Pass" ! else ! echo "RESULT:" $? ! fi; ! echo If you do not need to perform additional tests, remove the file 'test_creds' + REMOVE=x + while [ $REMOVE != 'y' ] && [ $REMOVE != 'Y' ] && + [ $REMOVE != 'n' ] && [ $REMOVE != 'N' ] ; do + read -p "Remove now? (Y/n): " REMOVE + done; + + if [ $REMOVE == 'y' ] || [ $REMOVE == 'Y' ] ; then + rm $SCRIPTDIR/test_creds + fi; |