Skip to content

Instantly share code, notes, and snippets.

@prochor666
Last active August 10, 2021 14:06
Show Gist options
  • Save prochor666/cbe0e2cc92926cd738c3deb640440214 to your computer and use it in GitHub Desktop.
Save prochor666/cbe0e2cc92926cd738c3deb640440214 to your computer and use it in GitHub Desktop.
Test if php module is installed
#~/bin/bash
# @author prochor666@gmail.com
# Test if php module is installed
function moduleIsInstalled()
{
if [[ -z "$(php -m | grep ${@})" ]];
then
echo "ERROR: ${@} module is not installed"
else
echo "SUCCESS: ${@} is installed and loaded"
fi
}
echo "PHP version"
php -v
echo "............................."
read -p 'Enter module: ' MODULE
echo ""
moduleIsInstalled $MODULE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment