#!/bin/bash echo "Content-type: text/html" echo if [ "$REQUEST_METHOD" = "POST" ]; then if [ "$CONTENT_TYPE" = "application/json" ]; then SECRET=$(jq -r ".secret") if [ $SECRET = "SECRET" ]; then cd /var/www/html/12 git pull make # cat > /usr/lib/cgi-bin/webhook.json # read -n "$CONTENT_LENGTH" QUERY_STRING_POST else echo BAD SECRET fi else echo NOT JSON fi else echo NOT POST fi echo "done" # Example: Using backslashes to do multiline... # src: https://riptutorial.com/bash/example/29665/request-method--post--w-json # echo "