Dialplans + Shell scripts

First time posting, be kind :wink:

Running the following versions of the FreePBX distro.
Asterisk version 10.12.2
FreePBX version 2.11.0

I want to test the possiblity of using FreePBX as an IVR system as we currently outsource this functionality.

Simply put I want to offer customers a number they can call that will prompt them to enter their account number, when they do I want to execute a shell script that will log it to a file after doing a MOD10 check.

Can someone please point me in the right direction for some examples? Iโ€™ve got it working but what I canโ€™t figure out is how to get the shell script to return a TRUE/FALSE value back to the PBX in cases where the user enters the wrong account number and it does not validate.

Kindest Regards.