OS X shell script: evaluation of incoming web requests