Last active
August 10, 2021 14:06
-
-
Save prochor666/cbe0e2cc92926cd738c3deb640440214 to your computer and use it in GitHub Desktop.
Test if php module is installed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#~/bin/bash | |
# @author [email protected] | |
# 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