#!/bin/bash
TOOL=$(basename $0)
PHPVER=$(/usr/bin/find /etc/php-fpm.d/ -type f -iname "${USER}.conf" | /usr/bin/cut -f4 -d\/)
if [[ -z "$PHPVER" ]]; then
pushd /etc/php-fpm.d > /dev/null
PHPVER=$(/usr/bin/find . -type d | /usr/bin/tail -1)
popd > /dev/null
fi
exec /opt/lc/php/${PHPVER}/bin/${TOOL} "$@"