#!/bin/sh
set -e
CONFFILE=${1:-/etc/php/@PHP_VERSION@/fpm/php-fpm.conf}
errors=$(/usr/sbin/php-fpm@PHP_VERSION@ --fpm-config "$CONFFILE" -t 2>&1 | grep "\[ERROR\]" || true);
if [ -n "$errors" ]; then
    echo "Please fix your configuration file..."
    echo $errors
    exit 1
fi
exit 0
