And of course my open-source webhook server project: https://github.com/adnanh/webhook
And of course my open-source webhook server project: https://github.com/adnanh/webhook
It also adds the concurrency control feature so you don't have to worry if you want only one instance of the script running, or want to kill the currently running one, or run them in parallel etc...
Another feature would be generic trigger rules where you can use values from payload to see if the script should be run at all (i.e. push to the feature branch, but you want to run the script on merges to master...).
As a developer, all of this might sound easy to implement, but whatever you make, you also have to maintain... And as you know, the business requirements tend to change quite often and you'll get to a point where you have to generalize your custom CGI scripts, and you end up spending more time maintaining infrastructure than doing development on the actual product.
Webhook on other hand is pretty much a CGI server with a few handy features :-)