#!/bin/bash # # See if the desired ID is in the conference record database. # Return boolean VALID_RECORD_PIN. # # Use the Linux "lockfile" command to control concurrent access # #set -x declare -a array while read -e ARG && [ "$ARG" ] ; do array=(` echo $ARG | sed -e 's/://'`) export ${array[0]}=${array[1]} done checkresults() { while read line do case ${line:0:4} in "200 " ) echo $line >&2 return;; "510 " ) echo $line >&2 return;; "520 " ) echo $line >&2 return;; * ) echo $line >&2;; #keep on reading those Invlid command #command syntax until "520 End ..." esac done } IDWANTED=$1 echo "SET VARIABLE VALID_RECORD_PIN F" checkresults # Just validate that 131-136 was entered. Should really check all possible # files to make sure the recordings are there if test ${IDWANTED} -ge 131 -a ${IDWANTED} -le 136 then echo "SET VARIABLE VALID_RECORD_PIN T" checkresults fi exit 0;